Skip to content

Commit

Permalink
feat(elementUI): add formItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Jul 10, 2023
1 parent 337986e commit 93d12a8
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/ui/elementUI/formItem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "ElFormItem",
"props": {
"prop": {
"value": "",
"description": "传入 Form 组件的 model 中的字段,表单域 model 字段,在使用 validate、resetFields 方法的情况下,该属性是必填的",
"default": "",
"type": "string"
},
"label": {
"value": "",
"description": "标签文本",
"default": "",
"type": "string"
},
"label-width": {
"value": "",
"description": "表单域标签的的宽度,例如 '50px'。支持 auto。",
"default": "",
"type": "string"
},
"required": {
"value": "",
"description": "是否必填,如不设置,则会根据校验规则自动生成",
"default": "false",
"type": "boolean"
},
"rules": {
"value": "",
"description": "表单验证规则",
"default": "",
"type": "object"
},
"error": {
"value": "",
"description": "表单域验证错误信息, 设置该值会使表单验证状态变为error,并显示该错误信息",
"default": false,
"type": "string"
},
"show-message": {
"value": "",
"description": "是否显示校验错误信息",
"default": "false",
"type": "boolean"
},
"inline-message": {
"value": "",
"description": "以行内形式展示校验信息",
"default": "false",
"type": "boolean"
},
"size": {
"value": ["medium", "small", "mini"],
"description": "用于控制该表单内组件的尺寸",
"default": "",
"type": "string"
}
}
}
2 changes: 2 additions & 0 deletions src/ui/elementUI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ElRadio from './radio.json'
import ElRadioGroup from './radioGroup.json'
import ElRadioButton from './radioButton.json'
import ElForm from './form.json'
import ElFormItem from './formItem.json'

export function elementUI() {
const map: any = [
Expand All @@ -29,6 +30,7 @@ export function elementUI() {
ElRadioGroup,
ElRadioButton,
ElForm,
ElFormItem,
]

return map.reduce((result: any, item: any) => {
Expand Down

0 comments on commit 93d12a8

Please sign in to comment.