ElementUI - 调用组件中提供的方法

向右看齐 2021-07-26 17:01 684阅读 0赞

前言

  1. 在使用ElementUItree组件时,tree组件提供相应的方法,这是在使用iviewUI中所没有的

使用方法

  1. <template>
  2. <el-tree
  3. ref="tree"
  4. :data="data"
  5. :props="defaultProps"
  6. accordion
  7. @node-click="handleNodeClick">
  8. </el-tree>
  9. </template>
  10. <script>
  11. export default {
  12. name: '',
  13. methods: {
  14. methods () {
  15. // 返回目前被选中的节点所组成的数组
  16. this.$refs.tree.getCheckedNodes()
  17. }
  18. }
  19. }
  20. </script>

发表评论

表情:
评论列表 (有 0 条评论,684人围观)

还没有评论,来说两句吧...

相关阅读