diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index 3d546e9c7..2ffa9937f 100644 --- a/packages/hooks/src/index.ts +++ b/packages/hooks/src/index.ts @@ -1,2 +1,3 @@ export * from './onMountedOrActivated'; export * from './useAttrs'; +export * from './useRefs'; diff --git a/src/hooks/core/useRefs.ts b/packages/hooks/src/useRefs.ts similarity index 100% rename from src/hooks/core/useRefs.ts rename to packages/hooks/src/useRefs.ts diff --git a/src/components/Application/src/search/AppSearchModal.vue b/src/components/Application/src/search/AppSearchModal.vue index b37b22613..f50b41933 100644 --- a/src/components/Application/src/search/AppSearchModal.vue +++ b/src/components/Application/src/search/AppSearchModal.vue @@ -64,7 +64,7 @@ import { Icon } from '/@/components/Icon'; import vClickOutside from '/@/directives/clickOutside'; import { useDesign } from '/@/hooks/web/useDesign'; - import { useRefs } from '/@/hooks/core/useRefs'; + import { useRefs } from '@vben/hooks'; import { useMenuSearch } from './useMenuSearch'; import { useI18n } from '/@/hooks/web/useI18n'; import { useAppInject } from '/@/hooks/web/useAppInject'; diff --git a/src/components/Application/src/search/useMenuSearch.ts b/src/components/Application/src/search/useMenuSearch.ts index 9101b4ac9..1b8c71fb5 100644 --- a/src/components/Application/src/search/useMenuSearch.ts +++ b/src/components/Application/src/search/useMenuSearch.ts @@ -1,4 +1,5 @@ -import type { Menu } from '/@/router/types'; +import { type Menu } from '/@/router/types'; +import { type AnyFunction } from '@vben/types'; import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue'; import { getMenus } from '/@/router/menus'; import { cloneDeep } from 'lodash-es'; @@ -26,7 +27,7 @@ function createSearchReg(key: string) { return new RegExp(str); } -export function useMenuSearch(refs: Ref, scrollWrap: Ref, emit: EmitType) { +export function useMenuSearch(refs: Ref, scrollWrap: Ref, emit: AnyFunction) { const searchResult = ref([]); const keyword = ref(''); const activeIndex = ref(-1);