Add check event and getHalfChecedNodes method for Tree (#9730)

This commit is contained in:
FuryBean
2018-02-09 10:31:11 +08:00
committed by 杨奕
parent 607aef0ac7
commit fe29af1b1f
7 changed files with 69 additions and 12 deletions

View File

@@ -181,6 +181,15 @@
handleCheckChange(value, ev) {
this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
this.$nextTick(() => {
const store = this.tree.store;
this.tree.$emit('check', this.node.data, {
checkedNodes: store.getCheckedNodes(),
checkedKeys: store.getCheckedKeys(),
halfCheckedNodes: store.getHalfCheckedNodes(),
halfCheckedKeys: store.getHalfCheckedKeys(),
});
});
},
handleChildNodeExpand(nodeData, node, instance) {