Blogger Information
Blog 87
fans 1
comment 0
visits 59163
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
ElementUi - Tree 树形控件(躲坑)
阿杰
Original
648 people have browsed it

1、自定义节点内容

  • 按文档的来应该是下面的效果
  1. <el-tree
  2. :data="data"
  3. show-checkbox
  4. node-key="id"
  5. default-expand-all
  6. :expand-on-click-node="false">
  7. <span class="custom-tree-node" slot-scope="{ node, data }">
  8. <span>{{ node.label }}</span>
  9. <span>
  10. <el-button
  11. type="text"
  12. size="mini"
  13. @click="() => append(data)">
  14. Append
  15. </el-button>
  16. <el-button
  17. type="text"
  18. size="mini"
  19. @click="() => remove(node, data)">
  20. Delete
  21. </el-button>
  22. </span>
  23. </span>
  24. </el-tree>

  • 自己项目中

  • 鼠标移上去才显示自定义节点内容

  • 问题点就在于给了自定义节点标签个class

  • 去掉上面的class后,就可以得到想要的结果

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post