mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 01:11:15 +08:00
fix(amis-saas-6852): 完善表单脚手架,自动补全options
Change-Id: Ie4ff0ecf9212a1336af224b70c9d95151037241d
This commit is contained in:
parent
a0429cf7aa
commit
398cdef083
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "amis-editor",
|
||||
"version": "5.2.1-beta.26",
|
||||
"version": "5.2.1-beta.27",
|
||||
"description": "amis 可视化编辑器",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
|
@ -182,7 +182,27 @@ export class FormPlugin extends BasePlugin {
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
pipeOut: (values: any) => {
|
||||
// 给form中直接子元素(单选框、复选框)自动添加上默认options
|
||||
if (values && values.type === 'form' && values.body?.length > 0) {
|
||||
values.body.forEach((formItem: any) => {
|
||||
if (formItem.type === 'radios' || formItem.type === 'checkboxes') {
|
||||
formItem.options = [
|
||||
{
|
||||
label: "选项A",
|
||||
value: "A"
|
||||
},
|
||||
{
|
||||
label: "选项B",
|
||||
value: "B"
|
||||
}
|
||||
];
|
||||
}
|
||||
});
|
||||
}
|
||||
return values;
|
||||
}
|
||||
};
|
||||
|
||||
// scaffoldForm: ScaffoldForm = {
|
||||
|
Loading…
Reference in New Issue
Block a user