From e8d36d4f8244353bc8ea3e7cc6f06cbd232dc279 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Tue, 13 May 2025 21:46:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=96=E6=B6=88=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=99=A8=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/FileManagerContextMenu.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/components/FileManagerContextMenu.vue b/packages/frontend/src/components/FileManagerContextMenu.vue index d9e9fcf..8a6d9e9 100644 --- a/packages/frontend/src/components/FileManagerContextMenu.vue +++ b/packages/frontend/src/components/FileManagerContextMenu.vue @@ -26,7 +26,7 @@ const { isMobile } = useDeviceDetection(); const emit = defineEmits(['item-click', 'close-request']); // 添加 close-request const handleItemClick = (item: ContextMenuItem) => { - if (!item.disabled && item.action) { + if (item.action) { item.action(); // 只有当 action 存在时才执行 emit('close-request'); // <-- 发出关闭请求 } @@ -78,9 +78,7 @@ onUnmounted(() => { @click.stop="handleItemClick(subItem)" :class="[ 'px-4 py-1.5 cursor-pointer text-foreground text-sm flex items-center transition-colors duration-150 rounded mx-1', - subItem.disabled - ? 'text-text-secondary cursor-not-allowed opacity-60' - : 'hover:bg-primary/10 hover:text-primary' + 'hover:bg-primary/10 hover:text-primary' // 始终应用可点击样式 ]" > {{ subItem.label }} @@ -92,9 +90,7 @@ onUnmounted(() => { @click.stop="handleItemClick(menuItem)" :class="[ 'px-4 py-1.5 cursor-pointer text-foreground text-sm flex items-center transition-colors duration-150 rounded mx-1', - menuItem.disabled - ? 'text-text-secondary cursor-not-allowed opacity-60' - : 'hover:bg-primary/10 hover:text-primary' + 'hover:bg-primary/10 hover:text-primary' // 始终应用可点击样式 ]" > {{ menuItem.label }} @@ -119,9 +115,7 @@ onUnmounted(() => { @click.stop="handleItemClick(subItem)" :class="[ 'px-4 py-1.5 cursor-pointer text-foreground text-sm flex items-center transition-colors duration-150 rounded mx-1', - subItem.disabled - ? 'text-text-secondary cursor-not-allowed opacity-60' - : 'hover:bg-primary/10 hover:text-primary' + 'hover:bg-primary/10 hover:text-primary' // 始终应用可点击样式 ]" > {{ subItem.label }}