diff --git a/src/layouts/components/Topbar/Toolbar/NavSearch/search.vue b/src/layouts/components/Topbar/Toolbar/NavSearch/search.vue index 78d524ff..44f5c9a0 100644 --- a/src/layouts/components/Topbar/Toolbar/NavSearch/search.vue +++ b/src/layouts/components/Topbar/Toolbar/NavSearch/search.vue @@ -6,6 +6,7 @@ import useMenuStore from '@/store/modules/menu' import useRouteStore from '@/store/modules/route' import useSettingsStore from '@/store/modules/settings' import { resolveRoutePath } from '@/utils' +import { useFocus } from '@vueuse/core' import hotkeys from 'hotkeys-js' defineOptions({ @@ -29,6 +30,8 @@ interface listTypes { } const searchInput = ref('') +const searchInputRef = useTemplateRef('searchInputRef') +const { focused: searchInputFocused } = useFocus(searchInputRef) const sourceList = ref([]) const actived = ref(-1) @@ -197,13 +200,13 @@ function pageJump(path: listTypes['path'], link: listTypes['link']) {