element-plus/packages/utils/vue/refs.ts

10 lines
271 B
TypeScript
Raw Normal View History

import type { ComponentPublicInstance, Ref } from 'vue'
export const composeRefs = (...refs: Ref<HTMLElement | null>[]) => {
return (el: Element | ComponentPublicInstance | null) => {
refs.forEach((ref) => {
ref.value = el as HTMLElement | null
})
}
}