From 8b97a0c09b65a55bae0eb8875dd58c2b101cb08c Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期二, 17 十二月 2024 14:26:23 +0800 Subject: [PATCH] 优化TopNav内链菜单点击没有高亮(IB8WHJ) --- src/plugins/tab.js | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/tab.js b/src/plugins/tab.js index cc332b5..004aa86 100644 --- a/src/plugins/tab.js +++ b/src/plugins/tab.js @@ -1,4 +1,4 @@ -import useTagsViewStore from '@/store/modules/tagsview' +import useTagsViewStore from '@/store/modules/tagsView' import router from '@/router' export default { @@ -32,8 +32,12 @@ // 鍏抽棴鎸囧畾tab椤电 closePage(obj) { if (obj === undefined) { - return useTagsViewStore().delView(router.currentRoute.value).then(({ lastPath }) => { - return router.push(lastPath || '/index'); + return useTagsViewStore().delView(router.currentRoute.value).then(({ visitedViews }) => { + const latestView = visitedViews.slice(-1)[0] + if (latestView) { + return router.push(latestView.fullPath) + } + return router.push('/'); }); } return useTagsViewStore().delView(obj); -- Gitblit v1.9.3