Skip to content

Commit

Permalink
feat: 当搜索菜单结果为空时不触发enter事件
Browse files Browse the repository at this point in the history
  • Loading branch information
yanbowe authored and buqiyuan committed Jan 5, 2022
1 parent 2cdcb71 commit 75c9f55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/layout/header/components/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
/** key enter */
function handleEnter() {
const { length } = resultOptions.value;
if (length === 0 || activePath.value === '') return;
if (/http(s)?:/.test(activePath.value)) {
window.open(activePath.value);
} else {
Expand Down
1 change: 1 addition & 0 deletions src/router/staticModules/besidesLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const REDIRECT_ROUTE: RouteRecordRaw = {
component: RouterView,
meta: {
title: REDIRECT_NAME,
hideInMenu: true,
},
beforeEnter: (to) => {
const { params, query } = to;
Expand Down

0 comments on commit 75c9f55

Please sign in to comment.