types(VForm): Adding VForm types

This commit is contained in:
陈凯龙
2021-12-13 16:55:58 +08:00
parent bc9195b21e
commit 7528fe6da6
14 changed files with 217 additions and 80 deletions

View File

@@ -472,24 +472,9 @@ declare global {
}
declare type FormSchema = {
/**
* @field form model key
*/
field: string
/**
* @label form-item label
*/
label?: string
/**
* @colProps ElCol props
*/
colProps?: ColProps
/**
* @componentProps El Components props
*/
componentProps?:
| RadioProps
| CheckboxProps
@@ -508,38 +493,14 @@ declare global {
| DividerProps
| TimeSelectProps
| SelectV2Props
/**
* @formItemProps form-item props
*/
formItemProps?: FormItemProps
/**
* @component Component
*/
component?: ComponentName
/**
* @value form model value
*/
value?: FormValueTypes
/**
* @options Component options
*/
options?: FormOptions[]
/**
* @optionsField option alias
*/
optionsField?: FormOptionsAlias
/**
* @hidden form-item hidden
*/
hidden?: boolean
}
// BfForm types end
declare type BfFormSchema = FormSchema[]
// VForm types end
declare type VFormSchema = FormSchema[]
}

View File

@@ -10,6 +10,6 @@ declare type ElememtPlusSzie = 'medium' | 'small' | 'mini'
declare type ElementPlusInfoType = 'success' | 'info' | 'warning' | 'danger'
declare type Recordable<T = any> = Record<string, T>
declare type Recordable<T = any, K = string> = Record<K extends null | undefined ? string : K, T>
declare type ComponentRef<T> = InstanceType<T>