mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* refactor(loading): refactored loading component * refactor(loading): use render & createVNode instead of createApp Co-authored-by: Ryan <ryanzhao2128@gmail.com>
48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
import type { Ref, VNode } from 'vue'
|
|
|
|
export type ILoadingOptions = {
|
|
parent?: ILoadingParentElement
|
|
background?: string
|
|
spinner?: boolean | string
|
|
text?: string
|
|
fullscreen?: boolean
|
|
body?: boolean
|
|
lock?: boolean
|
|
customClass?: string
|
|
visible?: boolean
|
|
target?: string | HTMLElement
|
|
}
|
|
|
|
export type ILoadingInstance = {
|
|
parent?: Ref<ILoadingParentElement>
|
|
background?: Ref<string>
|
|
spinner?: Ref<boolean | string>
|
|
text?: Ref<string>
|
|
fullscreen?: Ref<boolean>
|
|
body?: Ref<boolean>
|
|
lock?: Ref<boolean>
|
|
customClass?: Ref<string>
|
|
visible?: Ref<boolean>
|
|
target?: Ref<string | HTMLElement>
|
|
originalPosition?: Ref<string>
|
|
originalOverflow?: Ref<string>
|
|
setText: (text: string) => void
|
|
close: () => void
|
|
handleAfterLeave: () => void
|
|
vm: VNode
|
|
$el: HTMLElement
|
|
}
|
|
|
|
export type ILoadingGlobalConfig = {
|
|
fullscreenLoading: ILoadingInstance
|
|
}
|
|
|
|
export type ILoadingCreateComponentParams = {
|
|
options: ILoadingOptions
|
|
globalLoadingOption: ILoadingGlobalConfig
|
|
}
|
|
|
|
export interface ILoadingParentElement extends HTMLElement {
|
|
vLoadingAddClassList?: () => void
|
|
}
|