提交 819409a8 编写于 作者: zhentian.jia's avatar zhentian.jia

子节点被选中

上级 db96d045
......@@ -1456,8 +1456,21 @@ export default {
}
}
},
appendCheck() {
//子节点选中
appendCheck(administrative,checked) {
//console.log(checked,administrative)
let checkList = [];
checkList = this.$refs.tree.getCheckedKeys();
//this.$refs.tree.setCheckedKeys(checkList);
if(checked) {
for(let i=0;i<administrative.length;i++) {
checkList.push(administrative[i].id);
// console.log(checkList);
}
}
this.$nextTick(function(){
this.$refs.tree.setCheckedKeys(checkList);
});
},
//添加子节点
append(data, node) {
......@@ -1485,7 +1498,8 @@ export default {
//console.log(administrative);
data.children = administrative;
//data.children.push(newChild);
//this.onChecked()
this.appendCheck(administrative,node.checked);
}
});
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册