标签:log return 根据 lis foreach children 结构 this lte
有name存在的是父级数据,再根据deptCode相同来匹配到同类子集的数据放到父级里面
this.getFatherData = this.list.filter((ele,index) => {
console.log(ele)
return ele.name
})
console.log(this.getFatherData,4444)
this.getFatherData.forEach((ele)=>{
ele.children= this.list.filter((element)=>{
return element.deptCode === ele.deptCode && !element.name
})
})
标签:log return 根据 lis foreach children 结构 this lte
原文地址:https://www.cnblogs.com/antyhouse/p/10216632.html