Open mcya opened 6 years ago
const renderTreeNodes = (data = []) => (data.length === 0 ? null : data.map((item = {}) => {// 树形组件遍历
if (item.children) {
return (
<TreeNode title={item.projname} key={item.projid} dataRef={item}>
{renderTreeNodes(item.children)}
</TreeNode>
);
}
return <TreeNode {...item} />;
}));
带 children 的遍历方式~ rect项目