From 3e72c3b45ab963ff9a2bd981a2fb4e2dd817abb8 Mon Sep 17 00:00:00 2001 From: Soybean Date: Sat, 21 Sep 2024 08:22:32 +0800 Subject: [PATCH] fix(projects): fix global-tab click conflict with contextmenu --- src/layouts/modules/global-tab/index.vue | 4 +++- src/utils/agent.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/utils/agent.ts diff --git a/src/layouts/modules/global-tab/index.vue b/src/layouts/modules/global-tab/index.vue index e87527a7..7e95fbaf 100644 --- a/src/layouts/modules/global-tab/index.vue +++ b/src/layouts/modules/global-tab/index.vue @@ -8,6 +8,7 @@ import { useAppStore } from '@/store/modules/app'; import { useThemeStore } from '@/store/modules/theme'; import { useRouteStore } from '@/store/modules/route'; import { useTabStore } from '@/store/modules/tab'; +import { isPC } from '@/utils/agent'; import ContextMenu from './context-menu.vue'; defineOptions({ @@ -24,6 +25,7 @@ const bsWrapper = ref(); const { width: bsWrapperWidth, left: bsWrapperLeft } = useElementBounding(bsWrapper); const bsScroll = ref>(); const tabRef = ref(); +const isPCFlag = isPC(); const TAB_DATA_ID = 'data-tab-id'; @@ -166,7 +168,7 @@ init();