diff --git a/packages/effects/hooks/src/use-tabs.ts b/packages/effects/hooks/src/use-tabs.ts index 526721127..978409ed1 100644 --- a/packages/effects/hooks/src/use-tabs.ts +++ b/packages/effects/hooks/src/use-tabs.ts @@ -47,7 +47,7 @@ export function useTabs() { } async function openTabInNewWindow(tab?: RouteLocationNormalized) { - await tabbarStore.openTabInNewWindow(tab || route); + await tabbarStore.openTabInNewWindow(tab || route, router); } async function closeTabByKey(key: string) { diff --git a/packages/stores/src/modules/tabbar.ts b/packages/stores/src/modules/tabbar.ts index 14af7be98..e94113869 100644 --- a/packages/stores/src/modules/tabbar.ts +++ b/packages/stores/src/modules/tabbar.ts @@ -14,7 +14,7 @@ import { markRaw, toRaw } from 'vue'; import { preferences } from '@vben-core/preferences'; import { createStack, - openRouteInNewWindow, + openWindow, Stack, startProgress, stopProgress, @@ -371,8 +371,9 @@ export const useTabbarStore = defineStore('core-tabbar', { * @zh_CN 新窗口打开标签页 * @param tab */ - async openTabInNewWindow(tab: TabDefinition) { - openRouteInNewWindow(tab.fullPath || tab.path); + async openTabInNewWindow(tab: TabDefinition, router: Router) { + const href = router.resolve(tab.fullPath || tab.path).href; + openWindow(new URL(href, location.href).href, { target: '_blank' }); }, /**