Update tree.vue

This commit is contained in:
Aresn 2020-02-24 10:08:44 +08:00 committed by GitHub
parent 076310a789
commit 8301bf1e7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,7 +171,7 @@
}
},
handleSelect (nodeKey) {
if (!this.flatState[nodeKey]) return
if (!this.flatState[nodeKey]) return;
const node = this.flatState[nodeKey].node;
if (!this.multiple){ // reset previously selected node
const currentSelectedKey = this.flatState.findIndex(obj => obj.node.selected);
@ -182,7 +182,7 @@
this.$emit('on-select-change', this.getSelectedNodes(), node);
},
handleCheck({ checked, nodeKey }) {
if (!this.flatState[nodeKey]) return
if (!this.flatState[nodeKey]) return;
const node = this.flatState[nodeKey].node;
this.$set(node, 'checked', checked);
this.$set(node, 'indeterminate', false);