diff --git a/src/layouts/common/global-search/components/search-modal.vue b/src/layouts/common/global-search/components/search-modal.vue index 3a0a20c7..b562c77e 100644 --- a/src/layouts/common/global-search/components/search-modal.vue +++ b/src/layouts/common/global-search/components/search-modal.vue @@ -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() {