Tree: stopPropagation and preventDefault for node-contextmenu if bound (#10123)

pull/9721/merge
FuryBean 2018-03-14 15:16:52 +08:00 committed by 杨奕
parent 5797325c73
commit 0c8523bce9
1 changed files with 4 additions and 0 deletions

View File

@ -165,6 +165,10 @@
}, },
handleContextMenu(event) { handleContextMenu(event) {
if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
event.stopPropagation();
event.preventDefault();
}
this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this); this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
}, },