Commit 700a3707b68929e96eb0529e7e3fde8591aafd14

Authored by qq240814476
1 parent d411992d

tree on-select-change/on-check-change add node

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/components/tree/tree.vue
@@ -159,7 +159,7 @@ @@ -159,7 +159,7 @@
159 } 159 }
160 this.$set(node, 'selected', !node.selected); 160 this.$set(node, 'selected', !node.selected);
161 161
162 - this.$emit('on-select-change', this.getSelectedNodes()); 162 + this.$emit('on-select-change', this.getSelectedNodes(), node);
163 }, 163 },
164 handleCheck({ checked, nodeKey }) { 164 handleCheck({ checked, nodeKey }) {
165 const node = this.flatState[nodeKey].node; 165 const node = this.flatState[nodeKey].node;
@@ -169,7 +169,7 @@ @@ -169,7 +169,7 @@
169 this.updateTreeUp(nodeKey); // propagate up 169 this.updateTreeUp(nodeKey); // propagate up
170 this.updateTreeDown(node, {checked, indeterminate: false}); // reset `indeterminate` when going down 170 this.updateTreeDown(node, {checked, indeterminate: false}); // reset `indeterminate` when going down
171 171
172 - this.$emit('on-check-change', this.getCheckedNodes()); 172 + this.$emit('on-check-change', this.getCheckedNodes(), node);
173 } 173 }
174 }, 174 },
175 created(){ 175 created(){