wip(VForm): VForm component development

This commit is contained in:
kailong321200875
2021-12-18 20:09:05 +08:00
parent d9d64f3931
commit 28be932fd2
10 changed files with 526 additions and 81 deletions

View File

@@ -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