mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
Tree: add node-contextmenu event for tree node (#9678)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user