<el-tree
:load="loadNode"
lazy
show-checkbox
:props="props"
:render-content="renderContent"
node-key="id"
:default-checked-keys="checked"
:default-expanded-keys="path"
@check-change="getCheck"
@check="checkedExpand"
ref="tree"
></el-tree>
checkedExpand(items) {
//点击勾选默认展开所有的子节点
this.$refs.tree.store.defaultExpandAll = true
//获取所有子节点
let res = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
this.path = res
},
本文介绍 Element UI 中树形组件的使用方法,包括如何加载数据、设置默认展开状态、处理勾选事件及获取已勾选节点等关键功能。
1万+

被折叠的 条评论
为什么被折叠?



