From 02c2e4fc4b09f01912ec24fea0608251ed034b5a Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 30 Oct 2023 23:33:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB`ifr?= =?UTF-8?q?ame`=E9=A1=B5=E9=9D=A2=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=8F=B3=E9=94=AE=E6=A0=87=E7=AD=BE=E9=A1=B5=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=8F=B3=E9=94=AE=E6=A0=87=E7=AD=BE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E8=A2=AB=E9=81=AE=E6=8C=A1=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/tag/index.vue | 9 ++++++++- src/layout/frameView.vue | 1 - src/layout/hooks/useTag.ts | 9 --------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/layout/components/tag/index.vue b/src/layout/components/tag/index.vue index 685b7e30a..adf775fcb 100644 --- a/src/layout/components/tag/index.vue +++ b/src/layout/components/tag/index.vue @@ -6,10 +6,10 @@ import { useTags } from "../../hooks/useTag"; import { routerArrays } from "@/layout/types"; import { handleAliveRoute, getTopMenu } from "@/router/utils"; import { useSettingStoreHook } from "@/store/modules/settings"; -import { useResizeObserver, useFullscreen } from "@vueuse/core"; import { isEqual, isAllEmpty, debounce } from "@pureadmin/utils"; import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; import { ref, watch, unref, toRaw, nextTick, onBeforeUnmount } from "vue"; +import { useResizeObserver, useFullscreen, onClickOutside } from "@vueuse/core"; import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill"; import Fullscreen from "@iconify-icons/ri/fullscreen-fill"; @@ -49,6 +49,7 @@ const { const tabDom = ref(); const containerDom = ref(); const scrollbarDom = ref(); +const contextmenuRef = ref(); const isShowArrow = ref(false); const topPath = getTopMenu()?.path; const { VITE_HIDE_HOME } = import.meta.env; @@ -328,6 +329,7 @@ function handleCommand(command: any) { /** 触发右键中菜单的点击事件 */ function selectTag(key, item) { + closeMenu(); onClickDrop(key, item, currentSelect.value); } @@ -462,6 +464,10 @@ function tagOnClick(item) { // showMenuModel(item?.path, item?.query); } +onClickOutside(contextmenuRef, closeMenu, { + detectIframe: true +}); + watch(route, () => { activeIndex.value = -1; dynamicTagView(); @@ -558,6 +564,7 @@ onBeforeUnmount(() => {