xiaochan 2 lat temu
rodzic
commit
e3a45f5396
1 zmienionych plików z 3 dodań i 5 usunięć
  1. 3 5
      src/components/menu-item/RightClickMenu.vue

+ 3 - 5
src/components/menu-item/RightClickMenu.vue

@@ -57,11 +57,9 @@ let displayLocation = $ref({
 
 const handlingClickEvents = (cb, index) => {
     let data = props.config[index]
-    if (data.validator) {
-        if (!data.validator(props.mousePosition.data)) {
-            modal.value = false
-            return;
-        }
+    if (data.validator && !data.validator(props.mousePosition.data)) {
+        modal.value = false
+        return;
     }
 
     cb(props.mousePosition.data, props.mousePosition.index);