代码:
if(item2.children && item2.children.length > 0){ item2.children.forEach(item3=>{ item3.label = item3.name if(item3.children.length == 0){ delete item3["children"] } }) }
代码:
if(item2.children && item2.children.length > 0){ item2.children.forEach(item3=>{ item3.label = item3.name if(item3.children.length == 0){ delete item3["children"] } }) }