递归

<!--修改二级字段-->
const
list = this.pcTreeData.map(item => { const arr = item.btnInfoVos.map(i => { return { ...i, id: i.btnCode, componentTitle: i.btnName } }) return { ...item, btnInfoVos: arr } })
this.pcTreeData = list
<!--修改一级字段--> 
res.data.forEach(item => { item.btnCode = item.id; item.btnName = item.componentTitle; }); this.treeData = res.data;

 

posted @ 2024-05-27 17:32  bingxiaoxiao  阅读(3)  评论(0编辑  收藏  举报