Skip to content

Schema

表单的 Schema 配置,基于JSON Schema 规范

属性名类型默认值描述
type'string' | 'array' | 'number' | 'boolean' | 'date'-表单协议配置
titlestring-用于渲染控件 label,title 为空时,label 不渲染
borderbooleantrue是否展示边框
requiredbooleanfalse是否必填
placeholderstring-空值占位(需对应渲染控件支持 placeholder,才可生效)
disabledbooleanfalse是否禁用
readonlybooleanfalse是否只读
hiddenbooleanfalse是否隐藏当前选项
displayType'row' | 'column''row'指定 Label 与 Field 的展示关系,row 表示并排展示,column 表示两排展示
classNamestring-控件类名(用来做样式覆盖)
widgetstring-指定使用哪个组件来渲染,除内置控件外,自定义控件需要注册才可使用
enumarray-可用来生成组件的 options 的 value,例: [1,2] => [{label:1 , value:1},{label:2 , value:2}],可使用 enumNames 制定 label
enumNamesarray-可用来生成组件的 options 的 label
rulesRule | Rule[]-指定组件校验逻辑, Rule

Released under the MIT License.