el-tree
1. 设置默认节点不显示问题
1. 弹窗@open设置默认选择节点
<el-dialog title="资源管理" :visible.sync="dialogFormVisible" @open="handleOpen">
。。。。
handleOpen(){
// 构建树
console.log(newcurrentNav)
this.$nextTick().then(() => {
this.$refs['tree'].setCheckedKeys(checkIds, true);
});
},
2. 深拷贝
async handleEdit(index, row) {
//得到这个角色下 下面的所有资源
var keysString = JSON.stringify(userMenuNodes);
var deepCopyUserMenuNodes = JSON.parse(keysString);
this.$nextTick(() => {
this.$refs.menutree.setCheckedKeys(deepCopyUserMenuNodes, true);
// set checked state of a node not affects its father and child nodes
this.checkStrictly = false;
});
},