Merge pull request #4850 from qq240814476/malintreenode

tree on-select-change/on-check-change add node
This commit is contained in:
Aresn 2018-12-06 11:16:28 +08:00 committed by GitHub
commit 895d4c09b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,7 +163,7 @@
} }
this.$set(node, 'selected', !node.selected); this.$set(node, 'selected', !node.selected);
this.$emit('on-select-change', this.getSelectedNodes()); this.$emit('on-select-change', this.getSelectedNodes(), node);
}, },
handleCheck({ checked, nodeKey }) { handleCheck({ checked, nodeKey }) {
const node = this.flatState[nodeKey].node; const node = this.flatState[nodeKey].node;
@ -173,7 +173,7 @@
this.updateTreeUp(nodeKey); // propagate up this.updateTreeUp(nodeKey); // propagate up
this.updateTreeDown(node, {checked, indeterminate: false}); // reset `indeterminate` when going down this.updateTreeDown(node, {checked, indeterminate: false}); // reset `indeterminate` when going down
this.$emit('on-check-change', this.getCheckedNodes()); this.$emit('on-check-change', this.getCheckedNodes(), node);
} }
}, },
created(){ created(){