清除 element el-tree 已选中的选项,光是清除 default-checked-keys 值是没用的
element 的 el-tree 组件是采用赋值的方式改变是否勾选的,所以你应该使用组件中提供的 this.$refs.tree.setCheckedKeys([]);
我这里用到的是:
this.$nextTick(() => {
this.$refs.elTree.setCheckedKeys([]);
});
清除 element el-tree 已选中的选项,光是清除 default-checked-keys 值是没用的
element 的 el-tree 组件是采用赋值的方式改变是否勾选的,所以你应该使用组件中提供的 this.$refs.tree.setCheckedKeys([]);
我这里用到的是:
this.$nextTick(() => {
this.$refs.elTree.setCheckedKeys([]);
});