From 47afa9209ee100375e10ee0071002be742798098 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 12 Jun 2024 14:56:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=B1=9E=E6=80=A7`fixedTag`=E4=B8=BA`false`?= =?UTF-8?q?=E5=90=8E=E5=BD=93=E5=89=8D=E6=A0=87=E7=AD=BE=E9=A1=B5=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E5=85=B3=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/lay-tag/index.vue | 11 ++++++----- src/layout/hooks/useTag.ts | 7 +++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/layout/components/lay-tag/index.vue b/src/layout/components/lay-tag/index.vue index 373ceea44c..87f234fda4 100644 --- a/src/layout/components/lay-tag/index.vue +++ b/src/layout/components/lay-tag/index.vue @@ -37,6 +37,7 @@ const { buttonLeft, showModel, translateX, + isFixedTag, pureSetting, activeIndex, getTabStyle, @@ -578,7 +579,7 @@ onBeforeUnmount(() => { 'scroll-item is-closable', linkIsActive(item), showModel === 'chrome' && 'chrome-item', - !isAllEmpty(item?.meta?.fixedTag) && 'fixed-tag' + isFixedTag(item) && 'fixed-tag' ]" @contextmenu.prevent="openMenu(item, $event)" @mouseenter.prevent="onMouseenter(index)" @@ -593,10 +594,10 @@ onBeforeUnmount(() => { { {{ transformI18n(item.meta.title) }} diff --git a/src/layout/hooks/useTag.ts b/src/layout/hooks/useTag.ts index e82e36ff67..aff70f1cde 100644 --- a/src/layout/hooks/useTag.ts +++ b/src/layout/hooks/useTag.ts @@ -125,6 +125,12 @@ export function useTags() { } } + const isFixedTag = computed(() => { + return item => { + return isBoolean(item?.meta?.fixedTag) && item?.meta?.fixedTag === true; + }; + }); + const iconIsActive = computed(() => { return (item, index) => { if (index === 0) return; @@ -221,6 +227,7 @@ export function useTags() { buttonTop, buttonLeft, translateX, + isFixedTag, pureSetting, activeIndex, getTabStyle,