element-plus/packages/tokens/dialog.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

14 lines
440 B
TypeScript

import type { ComputedRef, CSSProperties, InjectionKey, Ref } from 'vue'
import type { useNamespace } from '@element-plus/hooks'
export type DialogContext = {
dialogRef: Ref<HTMLElement | undefined>
headerRef: Ref<HTMLElement | undefined>
ns: ReturnType<typeof useNamespace>
rendered: Ref<boolean>
style: ComputedRef<CSSProperties>
}
export const dialogInjectionKey: InjectionKey<DialogContext> =
Symbol('dialogInjectionKey')