2019-04-30 11:11:25 +08:00
|
|
|
export default {
|
2019-11-07 10:41:14 +08:00
|
|
|
type: 'page',
|
2022-04-24 10:46:23 +08:00
|
|
|
title: '表单选项的联动',
|
2019-11-07 10:41:14 +08:00
|
|
|
body: {
|
|
|
|
type: 'form',
|
|
|
|
mode: 'horizontal',
|
|
|
|
title: '',
|
|
|
|
actions: [],
|
2022-04-24 10:46:23 +08:00
|
|
|
debug: true,
|
2021-06-07 10:09:55 +08:00
|
|
|
body: [
|
2019-11-07 10:41:14 +08:00
|
|
|
'<p class="text-danger">表单选项内也能联动,通过配置 visibleOn、hiddenOn或者disabledOn</p>',
|
|
|
|
{
|
|
|
|
type: 'divider'
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项1',
|
2021-06-07 10:09:55 +08:00
|
|
|
type: 'list-select',
|
2019-11-07 10:41:14 +08:00
|
|
|
multiple: false,
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'a',
|
|
|
|
inline: true,
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '选项1',
|
|
|
|
value: 1
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项2',
|
|
|
|
value: 2
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项3',
|
|
|
|
value: 3
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
2022-04-24 10:46:23 +08:00
|
|
|
label: '选项级别联动',
|
2019-11-07 10:41:14 +08:00
|
|
|
type: 'radios',
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'b',
|
|
|
|
inline: true,
|
2022-04-24 10:46:23 +08:00
|
|
|
selectFirst: true,
|
2019-11-07 10:41:14 +08:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '选项1',
|
|
|
|
value: 1,
|
|
|
|
disabledOn: 'data.a == 1'
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项2',
|
|
|
|
value: 2,
|
|
|
|
hiddenOn: 'data.a == 2'
|
|
|
|
},
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-11-07 10:41:14 +08:00
|
|
|
{
|
|
|
|
label: '选项3',
|
|
|
|
value: 3,
|
|
|
|
visibleOn: 'data.a == 3'
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
]
|
2022-04-24 10:46:23 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
label: '组件级别联动',
|
|
|
|
type: 'radios',
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'b',
|
|
|
|
inline: true,
|
|
|
|
selectFirst: true,
|
|
|
|
visibleOn: 'data.a == 1',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '选项1',
|
|
|
|
value: 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
label: '选项级别联动',
|
|
|
|
type: 'radios',
|
|
|
|
labelClassName: 'text-muted',
|
|
|
|
name: 'b',
|
|
|
|
inline: true,
|
|
|
|
selectFirst: true,
|
|
|
|
visibleOn: 'data.a == 2',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '选项1',
|
|
|
|
value: 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '选项2',
|
|
|
|
value: 2
|
|
|
|
}
|
|
|
|
]
|
2019-11-07 10:41:14 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|