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

This commit is contained in:
qq240814476 2018-11-17 22:58:13 +08:00
parent d411992d07
commit 700a3707b6

View file

@ -159,7 +159,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;
@ -169,7 +169,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(){