Przeglądaj źródła

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

FuryBean 7 lat temu
rodzic
commit
0c8523bce9
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      packages/tree/src/tree-node.vue

+ 4 - 0
packages/tree/src/tree-node.vue

@@ -165,6 +165,10 @@
       },
 
       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);
       },