mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-13 15:12:10 +08:00
fix(@vben/stores): respect base URL when opening route in new window (#7837)
* fix(@vben/stores): respect base URL when opening route in new window * fix(@vben/stores): respect base URL when opening route in new window
This commit is contained in:
@@ -47,7 +47,7 @@ export function useTabs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function openTabInNewWindow(tab?: RouteLocationNormalized) {
|
async function openTabInNewWindow(tab?: RouteLocationNormalized) {
|
||||||
await tabbarStore.openTabInNewWindow(tab || route);
|
await tabbarStore.openTabInNewWindow(tab || route, router);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function closeTabByKey(key: string) {
|
async function closeTabByKey(key: string) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { markRaw, toRaw } from 'vue';
|
|||||||
import { preferences } from '@vben-core/preferences';
|
import { preferences } from '@vben-core/preferences';
|
||||||
import {
|
import {
|
||||||
createStack,
|
createStack,
|
||||||
openRouteInNewWindow,
|
openWindow,
|
||||||
Stack,
|
Stack,
|
||||||
startProgress,
|
startProgress,
|
||||||
stopProgress,
|
stopProgress,
|
||||||
@@ -371,8 +371,9 @@ export const useTabbarStore = defineStore('core-tabbar', {
|
|||||||
* @zh_CN 新窗口打开标签页
|
* @zh_CN 新窗口打开标签页
|
||||||
* @param tab
|
* @param tab
|
||||||
*/
|
*/
|
||||||
async openTabInNewWindow(tab: TabDefinition) {
|
async openTabInNewWindow(tab: TabDefinition, router: Router) {
|
||||||
openRouteInNewWindow(tab.fullPath || tab.path);
|
const href = router.resolve(tab.fullPath || tab.path).href;
|
||||||
|
openWindow(new URL(href, location.href).href, { target: '_blank' });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user