From 83cc3d7e9062c184de97787889a1e1de79bbfb30 Mon Sep 17 00:00:00 2001 From: yuyang Date: Sat, 3 Sep 2022 22:15:00 +0800 Subject: [PATCH] fix: tab-router refresh fail (#289) --- src/layouts/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 06739c9..540d8e8 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -114,10 +114,10 @@ export default defineComponent({ const route = tabRouters.find((i) => i.path === path); router.push({ path, query: route.query }); }; - const handleRefresh = (route: TRouterInfo) => { - tabsRouterStore.toggleTabRouterAlive(route.routeIdx); + const handleRefresh = (route: TRouterInfo, routeIdx: number) => { + tabsRouterStore.toggleTabRouterAlive(routeIdx); nextTick(() => { - tabsRouterStore.toggleTabRouterAlive(route.routeIdx); + tabsRouterStore.toggleTabRouterAlive(routeIdx); router.replace({ path: route.path, query: route.query }); }); }; @@ -198,7 +198,7 @@ export default defineComponent({ dropdown: () => router.path === route.path ? ( - handleRefresh(router)}> + handleRefresh(router, idx)}> 刷新