This commit is contained in:
xingyu4j
2025-08-19 17:41:16 +08:00
77 changed files with 3248 additions and 2831 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/layouts",
"version": "5.5.8",
"version": "5.5.9",
"homepage": "https://github.com/vbenjs/vue-vben-admin",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": {

View File

@@ -29,7 +29,8 @@ function useNavigation() {
return true;
}
const route = routeMetaMap.get(path);
return route?.meta?.openInNewWindow ?? false;
// 如果有外链或者设置了在新窗口打开,返回 true
return !!(route?.meta?.link || route?.meta?.openInNewWindow);
};
const resolveHref = (path: string): string => {
@@ -39,7 +40,13 @@ function useNavigation() {
const navigation = async (path: string) => {
try {
const route = routeMetaMap.get(path);
const { openInNewWindow = false, query = {} } = route?.meta ?? {};
const { openInNewWindow = false, query = {}, link } = route?.meta ?? {};
// 检查是否有外链
if (link && typeof link === 'string') {
openWindow(link, { target: '_blank' });
return;
}
if (isHttpUrl(path)) {
openWindow(path, { target: '_blank' });

View File

@@ -98,7 +98,7 @@ async function handleEnter() {
}
const to = result[index];
if (to) {
searchHistory.value.push(to);
searchHistory.value = uniqueByField([...searchHistory.value, to], 'path');
handleClose();
await nextTick();
if (isHttpUrl(to.path)) {