vue2遍历数组形成表格?-灵析社区

型男不是我还是谁

这是我写到table的vue 序号 材料题名 材料形成时间 页数 备注 年 月 日 一 履历材料 [ { label: '材料题名', children: [ { label: '目录一', }, { label: '目录一', } ] }, { label: '材料题名', children: [ { label: '目录一', children: [ { label: '目录1-1' } ] }, { label: '目录一', } ] } ] 现在有这么一个数组,children的数量不是固定的,把这个数组里面的内容展示成表格数据 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/26d8c8cf35ca0862e605bd26d1bdcf13.png) children的数据也是每一行数据,大概样子就是上面图片那样 table应该怎么写,各位大佬麻烦了挺急的

阅读量:83

点赞量:0

问AI
我头像最美
先把 tree 拍平成 arr,然后在 v-for 即可 不然就等用递归组件了,感觉不如直接用 js 递归好数据,然后 v-for