diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index 3d546e9c77a6744c6d5694cc8f256e454b64a9d9..2ffa9937fa9c93863df9baeb4f31536c78d366fd 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 b37b226130c24d38f7fcc3f9fa541183df0f06e8..f50b419337a3b7dd3b6511597126217cce21ffba 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 9101b4ac942bd6baaeafda7c9fb19591a39435d0..1b8c71fb5abac17538585a60398af2fbd2af135b 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);