@lowcodeui/element-form
v0.2.0
Published
![avatar](public/logo.png)
Downloads
25
Readme
e
API
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | ---- | -------- | ------ | -------------------------------------------------- | ------ | | type | 按钮类型 | String | primary / success / warning / danger / info / text | — | | icon | 图标类名 | string | — | — |
示例: //组件配置 每个都有提交当前,重置当前表单,不影响其他表单 formjson.footer.list=[ { label: "提交", name: "提交", type: "button", prop: { itemfotter: { style: "marginLeft:120px" }, item: { type: "primary", event: { click: e => { console.log("submit!", this.formlist[this.getIndex(e)]); } } } } }, { label: "重置", name: "重置", type: "button", prop: { itemfotter: { style: "marginLeft:10px" }, item: { type: "", event: { click: e => { this.formlist[this.getIndex(e)] = this.json; } } } } } ]
//所有组件示例 public formjson = { formprop: { labelWidth: "90px", rules: { name: [{ required: true, trigger: "blur", message: "必须填写" }] } }, formitem: [ { label: "姓名", name: "name", elcol: { list: [], prop: { span: 24 } }, type: "input", prop: { formitem: {}, item: { disabled: false } } }, { label: "身份证", name: "identityid", elcol: { list: [], prop: { span: 24 } }, type: "input" },
{
label: "时间",
name: "time",
elcol: {
list: [
{
elcol: { prop: { span: 4 } },
label: "",
name: "time0",
type: "datepicker"
}
]
}
},
{
label: "性别",
name: "sex",
elcol: { list: [], prop: { span: 2 } },
type: "radio",
list: ["男", "女"],
prop: { formitem: {}, item: {} }
},
{ label: "开关", name: "switch", type: "switch" },
{
label: "手机",
name: "phone",
elcol: { list: [], prop: { span: 24 } },
type: "input"
},
{
label: "社区",
name: "communityid",
type: "select",
prop: { item: { placeholder: "请选择" } },
list: [
{ label: "滨和社区", value: "001" },
{ label: "丰东社区", value: "002" }
]
},
{
label: "爱好",
name: "love",
type: "checkbox",
list: [
{ label: "滨和社区", name: "001" },
{ label: "丰东社区", name: "002" }
]
},
{
label: "居住地址",
name: "address",
elcol: { list: [], prop: { span: 24 } },
type: "input"
}
],
fotter: {
label: "",
name: "",
list: []
}
}