//过滤树形结构返回一个新的菜单
export function readNodes(nodes, arr = []) {
for (let item of nodes) {
// if (item.nodeClass !== 'Object') continue;
let obj = {
label: item.name,
icon: null,
key: item.menuId,
url: item.url,
children: item.list && item.list.length ? [] : null,
};
arr.push(obj);
if (item.list && item.list.length) readNodes(item.list, obj.children);
}
return arr;
}
11-28
1211
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)