Skip to content

Commit

Permalink
perf(components): Optimize menu search code
Browse files Browse the repository at this point in the history
  • Loading branch information
yanbowe committed Oct 18, 2023
1 parent 8c1ef4b commit 296a2d2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/layouts/common/global-search/components/search-modal.vue
Expand Up @@ -88,11 +88,7 @@ function search() {
const title = (menu.meta.i18nTitle ? $t(menu.meta.i18nTitle) : menu.meta.title).toLocaleLowerCase();
return trimKeyword && title.includes(trimKeyword);
});
if (resultOptions.value?.length > 0) {
activePath.value = resultOptions.value[0].path;
} else {
activePath.value = '';
}
activePath.value = resultOptions.value[0]?.path ?? '';
}
function handleClose() {
Expand Down

0 comments on commit 296a2d2

Please sign in to comment.