Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

ant design tree node节点造成tree父节点前面的三角消失

1.这样的代码可以正常显示,操作正常

`{ topic.map(item => (
    <TreeNode title={item.name} key={item._id}>
      {
        part(item).map(p => (
          <TreeNode title={p.name} key={p._id} />
        ))
      }
    </TreeNode>
  ))}`
  

正常如图

clipboard.png

2.我想要在子节点的那一列的最后一个添加一个title是+的节点,所以添加了如下代码

{ topic.map(item => (
    <TreeNode title={item.name} key={item._id}>
      {
        part(item).map(p => (
          <TreeNode title={p.name} key={p._id} />
        ))
      }
      <TreeNode title="+" key={`${item._id}1`} /> //增加的那行代码
    </TreeNode>
))}

此时变为如下状况,不知为何

clipboard.png
代码复现

http://codepen.io/anon/pen/KW...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...