我正在使用元素+,并希望在时间线中嵌入一棵树。我使用时间线组件作为模板:https://element-plus.org/en-US/component/timeline.html#custom-timestamp,下面是我的代码:
<el-timeline>
<el-timeline-item
v-for="(job, index) in jobList"
:key="index"
:timestamp="job.job_name"
>
<el-tree **:data="job"** :props="defaultProps" @node-click="handleNodeClick" />
</el-timeline-item>
</el-timeline>所以我试图将v-for中的“作业”传递给这个el-时间轴项中的子组件el-树,但它没有工作。我得到了第一个项目的时间线项目,然后是一个空树。
你能告诉我怎么通过吗?
发布于 2022-07-25 11:51:22
您提供给树组件的data支柱的值必须是Array类型,而不是一个对象。
https://stackoverflow.com/questions/73107693
复制相似问题