mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
65ac422ed6
* 补充容错 * fix: form 中 name 关联顶层数据初始化失效 * 更新 examples * 文档调整 * 删除多余的文档, 调整 schema * schema 调整 * schema 调整 * control 类型容器 control 改成 body * 修复一个选项加载的bug * form 注册直接用 type
69 lines
1.3 KiB
JavaScript
69 lines
1.3 KiB
JavaScript
export default {
|
|
type: 'page',
|
|
title: '表单选线的联动',
|
|
body: {
|
|
type: 'form',
|
|
mode: 'horizontal',
|
|
title: '',
|
|
actions: [],
|
|
body: [
|
|
'<p class="text-danger">表单选项内也能联动,通过配置 visibleOn、hiddenOn或者disabledOn</p>',
|
|
{
|
|
type: 'divider'
|
|
},
|
|
|
|
{
|
|
label: '选项1',
|
|
type: 'list-select',
|
|
multiple: false,
|
|
labelClassName: 'text-muted',
|
|
name: 'a',
|
|
inline: true,
|
|
options: [
|
|
{
|
|
label: '选项1',
|
|
value: 1
|
|
},
|
|
|
|
{
|
|
label: '选项2',
|
|
value: 2
|
|
},
|
|
|
|
{
|
|
label: '选项3',
|
|
value: 3
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
label: '选项2',
|
|
type: 'radios',
|
|
labelClassName: 'text-muted',
|
|
name: 'b',
|
|
inline: true,
|
|
options: [
|
|
{
|
|
label: '选项1',
|
|
value: 1,
|
|
disabledOn: 'data.a == 1'
|
|
},
|
|
|
|
{
|
|
label: '选项2',
|
|
value: 2,
|
|
hiddenOn: 'data.a == 2'
|
|
},
|
|
|
|
{
|
|
label: '选项3',
|
|
value: 3,
|
|
visibleOn: 'data.a == 3'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
};
|