Преглед на файлове

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

FuryBean преди 7 години
родител
ревизия
0c8523bce9
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  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);
       },