Skip to content

oxyzhg/formulate

Repository files navigation

Formulate

🚀 Automatic form builder based on vue3.

配置参数

AutoFrom Attributes

参数 说明 类型 是否必填
value 支持双向绑定的表单值,即 form object
schema 定义表单项的配置列表,子项类型可以是 array/object array
options 列表类表单的可选项,以 key 为唯一索引 object
rules 表单项的校验规则,以 key 为唯一索引 object
asyncErrors 异步校验错误信息,即用户可自定义错误信息 object
formProps form 组件参数对象 object
showActions 是否显示表单按钮组,若是能触发 submit 事件 boolean
submitBtnText 表单按钮组确定按钮的文本内容 string

Schema Item options

参数 说明 类型 是否必填
key 表单项唯一标识 string
type 表单项类型 string
fieldProps 组件实例配置 object
formItemProps form-item 组件配置 object
columnProps 仅在 schema 子项为数组时,column 配置列的参数 object
children 支持布局的子项 array
label formItemProps.label 简写形式 string
required formItemProps.required 简写形式 boolean
disabled fieldProps.disabled 简写形式 boolean
placeholder fieldProps.placeholder 简写形式 string
span columnProps.span 简写形式 string
offset columnProps.offset 简写形式 string
class columnProps.class 简写形式 string
style columnProps.style 简写形式 string
width 表单宽度,数组类型配置请使用 gs-ui/layout 布局 string/number
on 表单项的事件(适配性不太好) function

布局

Formulate 组件支持配置项布局,布局基于 Element 栅格布局,el-row 默认使用 flex 属性,与 el-col 相关的属性可以使用 columnProps 配置项属性传入,组件会自动适配样式。

目前暂不支持引入自定义的配置,后续会考虑启用相关的功能与配置。

About

🚀 Automatic form builder based on vue3.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published