this.loading =false
var data = res.result
var haveChild = (node) =>{
var myTree = Array.isArray(node.children) && node.children.length > 0
return {
id:node.id,
value:node.id,
title:node.partName,
children:myTree ? ndoe.children.map((i)=>haveChild(i)):[]
}
}
this.treeData = data.map((node)=>haveChild(node))
递归使用1
最新推荐文章于 2024-11-03 19:51:25 发布