diff --git a/src/components/tree/tree.vue b/src/components/tree/tree.vue index 9ee99fda..97b7c6d8 100644 --- a/src/components/tree/tree.vue +++ b/src/components/tree/tree.vue @@ -171,6 +171,7 @@ } }, handleSelect (nodeKey) { + 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); @@ -181,6 +182,7 @@ this.$emit('on-select-change', this.getSelectedNodes(), node); }, handleCheck({ checked, nodeKey }) { + if (!this.flatState[nodeKey]) return const node = this.flatState[nodeKey].node; this.$set(node, 'checked', checked); this.$set(node, 'indeterminate', false);