From 0594ae91c74fbc19c0bd7ccd2ad6f7f67597d32a Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sat, 28 Sep 2024 23:07:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtab=E9=A1=B5=E5=8F=AA?= =?UTF-8?q?=E5=89=A9=E4=B8=80=E4=B8=AA=E7=9A=84=E6=97=B6=E5=80=99=E6=97=A0?= =?UTF-8?q?=E6=B3=95=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/Tabs/index.vue | 2 +- src/stores/modules/tabs.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/layout/components/Tabs/index.vue b/src/layout/components/Tabs/index.vue index 723a895..ef529eb 100644 --- a/src/layout/components/Tabs/index.vue +++ b/src/layout/components/Tabs/index.vue @@ -79,7 +79,7 @@ watch( // 点击页签 const handleTabClick = (key: string) => { const obj = tabsStore.tabList.find((i) => i.path === key) - obj ? router.push(obj.fullPath) : router.push(key) + obj ? router.push(obj.fullPath || obj.path) : router.push(key) } diff --git a/src/stores/modules/tabs.ts b/src/stores/modules/tabs.ts index bbd7400..702f4d3 100644 --- a/src/stores/modules/tabs.ts +++ b/src/stores/modules/tabs.ts @@ -28,7 +28,8 @@ const storeSetup = () => { const isActive = router.currentRoute.value.path === tabList.value[index].path tabList.value.splice(index, 1) if (isActive) { - router.push(tabList.value[tabList.value.length - 1].fullPath) + const lastObj = tabList.value[tabList.value.length - 1] + router.push(lastObj.fullPath || lastObj.path) } }