From ec8dc3c6969736bef4a6d960ea1b0e908abd0f87 Mon Sep 17 00:00:00 2001 From: pdsuwwz Date: Mon, 24 Jul 2023 00:18:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=BE=EF=B8=8F=20feat:=20update=20tab=20?= =?UTF-8?q?item=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/WorkMenu/hooks.ts | 3 +++ src/widgets/WorkTabs/Tabs.vue | 21 +++++++++++++------ src/widgets/WorkTabs/TabsOptions.vue | 30 +++++++++++++++++++--------- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/widgets/WorkMenu/hooks.ts b/src/widgets/WorkMenu/hooks.ts index 2e07bee..d036923 100644 --- a/src/widgets/WorkMenu/hooks.ts +++ b/src/widgets/WorkMenu/hooks.ts @@ -65,8 +65,10 @@ export const useMenuHook = () => { ) let lockPush = false + let isMounted = false const handleSelect = (key: string) => { lockPush = true + isMounted = true router.push({ name: key }).finally(() => { @@ -77,6 +79,7 @@ export const useMenuHook = () => { const setActiveKey = async (key: string) => { activeKey.value = key + if (isMounted) return await nextTick() const selectedClassName = '.n-menu-item-content--selected' diff --git a/src/widgets/WorkTabs/Tabs.vue b/src/widgets/WorkTabs/Tabs.vue index 4731375..e48a351 100644 --- a/src/widgets/WorkTabs/Tabs.vue +++ b/src/widgets/WorkTabs/Tabs.vue @@ -33,7 +33,7 @@ class="tab-item-icon flex items-center" @click.stop="handleCloseTab(tabItem)" > - + @@ -41,7 +41,7 @@