el-tree 的运用
<el-tree
:data="dataList"
show-checkbox
:default-expand-all="false"
node-key="name"
ref="tree"
highlight-current
:props="defaultProps"
>
</el-tree>
getCheckedKeys() {
let shuju = this.$refs.tree.getCheckedKeys();
let checkNodes = this.$refs.tree.getCheckedNodes();
let userNames = [];
checkNodes.map((item) => {
if (item.children) {
return;
}
userNames.push(item.id);
});
// console.log(userNames);
this.ygsl = userNames.length;
this.bum = userNames.join(",");
this.flg = 2;
this.dialogFormVisible = false;
},
加班万岁!