标签:col 遍历 foreach item 递归遍历 nbsp obj children ons
changeData (data) {
const arr = []
if (data.length !== 0) {
data.forEach(item => {
const obj = {}
obj.id = item.path
obj.label = item.name
if (item.children.length >= 1) {
obj.children = this.changeData(item.children)
}
arr.push(obj)
})
}
return arr
}
标签:col 遍历 foreach item 递归遍历 nbsp obj children ons
原文地址:https://www.cnblogs.com/myunYao/p/14956615.html