diff --git a/src/pages/layout/tabBar.tsx b/src/pages/layout/tabBar.tsx index 893b46c..ce57e3d 100644 --- a/src/pages/layout/tabBar.tsx +++ b/src/pages/layout/tabBar.tsx @@ -43,6 +43,7 @@ function TabBar() { const index = visitedRoutes.findIndex(route => route.path === location.pathname) const affixTags = initAffixTags(menuList) const currentRoute = visitedRoutes[index] + switch (key) { case 'close': { if (!currentRoute.affix) { @@ -51,7 +52,7 @@ function TabBar() { break } case 'close-others': { - setVisitedRoute(affixTags.concat(visitedRoutes[index])) + addVisitedRoute(affixTags.concat(currentRoute)) break } case 'close-all': {