服务给的属性名自己需要重新处理,react中使用的
const handleTreeData = (params: any) => {
let data = params.map((item: any) => {
let children = item.children;
if (item.children) children = handleTreeData(item.children);
return {
title: item.name,
value: item.id,
children: children,
};
});
return data;
};