tree结构代码
需要加 show-checkbox check-strictly 这两个字段 和check-change 方法
node-key也是必须的哦!
<el-tree
ref="operate_tree"
:check-on-click-node="nodeSelectTwoState"
:data="areaListTwoTreeData"
node-key="id"
show-checkbox
check-strictly
:default-expanded-keys="['0-000000']"
:props="defaultProps"
@check-change="templateCheckChange">
</el-tree>
templateCheckChange(data,checked,node){
if(checked){
this.$refs.operate_tree.setCheckedNodes([data]);
}
},
网友评论