Skip to content

Commit

Permalink
fix: external link jump (vbenjs#4319)
Browse files Browse the repository at this point in the history
* fix: external link jump

* fix: external link jump

* chore: update deps

---------

Co-authored-by: Li Kui <[email protected]>
  • Loading branch information
2 people authored and kkfive committed Sep 14, 2024
1 parent 1922c0e commit ab43b3f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/effects/layouts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@vben-core/menu-ui": "workspace:*",
"@vben-core/popup-ui": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben-core/shared": "workspace:*",
"@vben-core/tabs-ui": "workspace:*",
"@vben/constants": "workspace:*",
"@vben/hooks": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SearchX, X } from '@vben/icons';
import { $t } from '@vben/locales';
import { mapTree, traverseTreeValues, uniqueByField } from '@vben/utils';
import { VbenIcon, VbenScrollbar } from '@vben-core/shadcn-ui';
import { isHttpUrl } from '@vben-core/shared';
import { onKeyStroke, useLocalStorage, useThrottleFn } from '@vueuse/core';
Expand Down Expand Up @@ -99,7 +100,11 @@ async function handleEnter() {
searchHistory.value.push(to);
handleClose();
await nextTick();
router.push(to.path);
if (isHttpUrl(to.path)) {
window.open(to.path, '_blank');
} else {
router.push({ path: to.path, replace: true });
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ab43b3f

Please sign in to comment.