1.数据格式不一致需要转成{label:,label,children}属性格式treeData = changeTreeData(data);
const treeData =changeTreeData(源数据);
changeTreeData=(data)=>{const temp=[]; data.map(item=>{const obj={
value:item.id,
label:item.name,
...item
};
if('children' in item){
obj['children']=changeTreeData(item.children);
}
temp.push(obj)
})
return temp;
}