diff --git a/src/hooks/core/useRefs.ts b/src/hooks/core/useRefs.ts index 79c280f9..ec380993 100644 --- a/src/hooks/core/useRefs.ts +++ b/src/hooks/core/useRefs.ts @@ -1,20 +1,16 @@ import type { Ref } from 'vue' import { onBeforeUpdate, ref } from 'vue' -function useRefs(): { refs: Ref; setRefs: (index: number) => (el: T) => void } { - const refs = ref([]) as Ref +export function useRefs(): [Ref, (index: number) => (el: HTMLElement) => void] { + const refs = ref([]) as Ref onBeforeUpdate(() => { refs.value = [] }) - const setRefs = (index: number) => (el: T) => { + const setRefs = (index: number) => (el: HTMLElement) => { refs.value[index] = el } - return { - refs, - setRefs, - } + return [refs, setRefs] } -export { useRefs }