renderTree = (data,idx) =>{
console.log('树形菜单数据源', data);
return data.map(item => {
if (!item.children) {
return (
<Tree>
<TreeNode className="first-level" title={
<div>
<span>{item.title}</span><span className="control">
<span>布置</span></span>
</div>} key={item.key}>
</TreeNode>
</Tree>
// <div>
// <TreeNode title={item.title} key={item.key} />
// </div>
)
} else {
return (
<Tree>
{this.renderTree(item.children)}
<TreeNode className="first-level" title={
<div>
<span>{item.title}</span><span className="control">
<span>布置</span></span>
</div>} key={item.key}>
</TreeNode>
</Tree>
// <TreeNode title={item.title} key={item.key}>
// </TreeNode>
)
}
})
};
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…