element-plus/packages/utils/vue/refs.ts
三咲智子 cb6300c739
refactor(components): [dialog] refactor (#6300)
* refactor(components): [dialog] refactor

- fix TS type.
- enhance prop type `beforeClose`
- move `token.ts` to `@element-plus/tokens`

* refactor: resolve review comments

* test: fix slots
2022-03-01 23:43:50 +08:00

10 lines
281 B
TypeScript

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