Tree: add node-contextmenu event for tree node (#9678)

This commit is contained in:
FuryBean
2018-02-06 11:42:01 +08:00
committed by 杨奕
parent 580aaaa3f9
commit 3bc67fa575
4 changed files with 8 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
<div
class="el-tree-node"
@click.stop="handleClick"
@contextmenu="($event) => this.handleContextMenu($event)"
v-show="node.visible"
:class="{
'is-expanded': expanded,
@@ -164,6 +165,10 @@
this.tree.$emit('node-click', this.node.data, this.node, this);
},
handleContextMenu(event) {
this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
},
handleExpandIconClick() {
if (this.node.isLeaf) return;
if (this.expanded) {