wip(VForm): VForm component development
This commit is contained in:
17
src/types/componentType.d.ts
vendored
17
src/types/componentType.d.ts
vendored
@@ -32,7 +32,7 @@ declare global {
|
||||
tag?: string
|
||||
}
|
||||
|
||||
declare type FormValueTypes = string | number | string[] | number[] | boolean | undefined
|
||||
declare type FormValueTypes = string | number | string[] | number[] | boolean | undefined | null
|
||||
|
||||
declare interface FormItemRule extends RuleItem {
|
||||
trigger?: string
|
||||
@@ -68,17 +68,30 @@ declare global {
|
||||
}
|
||||
|
||||
declare type VFormSchema = {
|
||||
// 唯一值
|
||||
field: string
|
||||
// 标题
|
||||
label?: string
|
||||
// col组件属性
|
||||
colProps?: ColProps
|
||||
componentProps?: Recordable
|
||||
// 表单组件属性,slots对应的是表单组件的插槽,规则:${field}-xxx,具体可以查看element-plus文档
|
||||
componentProps?: { slots?: Recordable } & Recordable
|
||||
// formItem组件属性
|
||||
formItemProps?: FormItemProps
|
||||
// 渲染的组件
|
||||
component?: ComponentName
|
||||
// 初始值
|
||||
value?: FormValueTypes
|
||||
// 下拉选项
|
||||
options?: FormOptions[]
|
||||
// 下拉选项别名
|
||||
optionsField?: FormOptionsAlias
|
||||
// 下拉选项插槽,规则:${field}-option
|
||||
optionsSlot?: boolean
|
||||
// 是否隐藏
|
||||
hidden?: boolean
|
||||
// 表单组件插槽,规则:${field}
|
||||
slot?: boolean
|
||||
}
|
||||
|
||||
// VForm types end
|
||||
|
||||
Reference in New Issue
Block a user