update Tree selected
This commit is contained in:
parent
6ff0e34003
commit
af7d72b4cc
2 changed files with 117 additions and 70 deletions
|
@ -147,9 +147,9 @@
|
|||
},
|
||||
handleSelect (nodeKey) {
|
||||
const node = this.flatState[nodeKey].node;
|
||||
if (!this.multiple){ // reset selected
|
||||
if (!this.multiple){ // reset previously selected node
|
||||
const currentSelectedKey = this.flatState.findIndex(obj => obj.node.selected);
|
||||
if (currentSelectedKey >= 0) this.$set(this.flatState[currentSelectedKey].node, 'selected', false);
|
||||
if (currentSelectedKey >= 0 && currentSelectedKey !== nodeKey) this.$set(this.flatState[currentSelectedKey].node, 'selected', false);
|
||||
}
|
||||
this.$set(node, 'selected', !node.selected);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue