mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 09:56:32 +08:00
fix: tab-router refresh fail (#289)
This commit is contained in:
parent
860a830407
commit
c4f89d5c5f
|
@ -114,10 +114,10 @@ export default defineComponent({
|
||||||
const route = tabRouters.find((i) => i.path === path);
|
const route = tabRouters.find((i) => i.path === path);
|
||||||
router.push({ path, query: route.query });
|
router.push({ path, query: route.query });
|
||||||
};
|
};
|
||||||
const handleRefresh = (route: TRouterInfo) => {
|
const handleRefresh = (route: TRouterInfo, routeIdx: number) => {
|
||||||
tabsRouterStore.toggleTabRouterAlive(route.routeIdx);
|
tabsRouterStore.toggleTabRouterAlive(routeIdx);
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
tabsRouterStore.toggleTabRouterAlive(route.routeIdx);
|
tabsRouterStore.toggleTabRouterAlive(routeIdx);
|
||||||
router.replace({ path: route.path, query: route.query });
|
router.replace({ path: route.path, query: route.query });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -198,7 +198,7 @@ export default defineComponent({
|
||||||
dropdown: () =>
|
dropdown: () =>
|
||||||
router.path === route.path ? (
|
router.path === route.path ? (
|
||||||
<t-dropdown-menu>
|
<t-dropdown-menu>
|
||||||
<t-dropdown-item onClick={() => handleRefresh(router)}>
|
<t-dropdown-item onClick={() => handleRefresh(router, idx)}>
|
||||||
<t-icon name="refresh" />
|
<t-icon name="refresh" />
|
||||||
刷新
|
刷新
|
||||||
</t-dropdown-item>
|
</t-dropdown-item>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user