Stephen Ma 2020-02-07 14:28:55 +08:00 committed by GitHub
parent a5f6f6cfcd
commit 076310a789
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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