[tree]添加node-open与node-close事件,共三个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。

This commit is contained in:
张华焱
2017-01-18 17:16:07 +08:00
parent b137274a61
commit 7d09486968
2 changed files with 43 additions and 0 deletions

View File

@@ -146,8 +146,10 @@
handleExpandIconClick() {
if (this.expanded) {
this.tree.$emit('node-close', this.node.data, this.node, this);
this.node.collapse();
} else {
this.tree.$emit('node-open', this.node.data, this.node, this);
this.node.expand();
this.$emit('node-expand', this.node.data, this.node, this);
}