mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
fix tree accordion bug when click on icon (#2440)
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
v-for="child in node.childNodes"
|
||||
:key="getNodeKey(child)"
|
||||
:node="child"
|
||||
@click.native="handleChildNodeClick(child)">
|
||||
@node-expand="handleChildNodeExpand(child)">
|
||||
</el-tree-node>
|
||||
</div>
|
||||
</collapse-transition>
|
||||
@@ -149,6 +149,7 @@
|
||||
this.node.collapse();
|
||||
} else {
|
||||
this.node.expand();
|
||||
this.$emit('node-expand', this.node.data, this.node, this);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -164,8 +165,8 @@
|
||||
}
|
||||
},
|
||||
|
||||
handleChildNodeClick(node) {
|
||||
this.broadcast('ElTreeNode', 'tree-node-click', node);
|
||||
handleChildNodeExpand(node) {
|
||||
this.broadcast('ElTreeNode', 'tree-node-expand', node);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -198,7 +199,7 @@
|
||||
}
|
||||
|
||||
if(this.tree.accordion) {
|
||||
this.$on('tree-node-click', node => {
|
||||
this.$on('tree-node-expand', node => {
|
||||
if(this.node !== node) {
|
||||
this.node.collapse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user