From f47fe9f19d3c71f389fa713744093aad14fb1592 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 28 Feb 2023 17:55:58 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B7=AF=E7=94=B1=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=20`showLink`=20=E8=AE=BE=E7=BD=AE=E6=88=90=20`false`=20?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=BD=93=E5=89=8D=E8=B7=AF=E7=94=B1=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=B8=8D=E6=B7=BB=E5=8A=A0=E5=88=B0=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/hooks/useTag.ts | 9 +++++++-- src/store/modules/multiTags.ts | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/layout/hooks/useTag.ts b/src/layout/hooks/useTag.ts index aed9f5848..40fb1922b 100644 --- a/src/layout/hooks/useTag.ts +++ b/src/layout/hooks/useTag.ts @@ -12,10 +12,15 @@ import { tagsViewsType } from "../types"; import { useEventListener } from "@vueuse/core"; import { useRoute, useRouter } from "vue-router"; import { transformI18n, $t } from "@/plugins/i18n"; -import { isEqual, isBoolean } from "@pureadmin/utils"; import { useSettingStoreHook } from "@/store/modules/settings"; import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; -import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils"; +import { + isEqual, + isBoolean, + storageLocal, + toggleClass, + hasClass +} from "@pureadmin/utils"; import Fullscreen from "@iconify-icons/ri/fullscreen-fill"; import CloseAllTags from "@iconify-icons/ri/subtract-line"; diff --git a/src/store/modules/multiTags.ts b/src/store/modules/multiTags.ts index 5099e25a5..70f9f1f95 100644 --- a/src/store/modules/multiTags.ts +++ b/src/store/modules/multiTags.ts @@ -1,9 +1,8 @@ import { defineStore } from "pinia"; import { store } from "@/store"; -import { isEqual } from "@pureadmin/utils"; import { routerArrays } from "@/layout/types"; import { multiType, positionType } from "./types"; -import { isUrl, storageLocal } from "@pureadmin/utils"; +import { isEqual, isBoolean, isUrl, storageLocal } from "@pureadmin/utils"; export const useMultiTagsStore = defineStore({ id: "pure-multiTags", @@ -54,6 +53,9 @@ export const useMultiTagsStore = defineStore({ if (isUrl(tagVal?.name)) return; // 如果title为空拒绝添加空信息到标签页 if (tagVal?.meta?.title.length === 0) return; + // showLink:false 不添加到标签页 + if (isBoolean(tagVal?.meta?.showLink) && !tagVal?.meta?.showLink) + return; const tagPath = tagVal.path; // 判断tag是否已存在 const tagHasExits = this.multiTags.some(tag => {