2019-04-30 11:11:25 +08:00
|
|
|
export default {
|
2019-11-07 10:41:14 +08:00
|
|
|
title: '显隐切换示例',
|
|
|
|
body: [
|
|
|
|
{
|
|
|
|
name: 'hiddenOn',
|
|
|
|
type: 'form',
|
|
|
|
mode: 'horizontal',
|
|
|
|
api: '/api/mock2/saveForm?waitSeconds=2',
|
|
|
|
title: 'Hide On 和 disabledOn 示例',
|
2021-06-07 10:09:55 +08:00
|
|
|
body: [
|
2019-04-30 11:11:25 +08:00
|
|
|
{
|
2019-11-07 10:41:14 +08:00
|
|
|
type: 'radios',
|
|
|
|
name: 'type',
|
|
|
|
label: '类型选择',
|
|
|
|
inline: true,
|
|
|
|
value: '1',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '类型 1',
|
|
|
|
value: '1'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '类型 2',
|
|
|
|
value: '2'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '类型 3',
|
|
|
|
value: '3'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
description: '<span class="text-danger">请切换类型来看效果</span>'
|
|
|
|
},
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
label: '所有可见',
|
|
|
|
name: 'text1'
|
|
|
|
},
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
label: '类型2 可见',
|
|
|
|
hiddenOn: 'data.type != 2',
|
|
|
|
name: 'text2'
|
|
|
|
},
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
label: '类型3 不可点',
|
|
|
|
disabledOn: 'data.type == 3',
|
|
|
|
name: 'text3'
|
|
|
|
},
|
|
|
|
{
|
2021-06-07 10:09:55 +08:00
|
|
|
type: 'input-text',
|
2019-11-07 10:41:14 +08:00
|
|
|
required: true,
|
|
|
|
label: '必填字段',
|
|
|
|
name: 'test4'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button-toolbar',
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
type: 'submit',
|
|
|
|
disabledOn: 'data.type == 1',
|
|
|
|
label: '类型1不可点'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'reset',
|
|
|
|
label: '类型3出现且不可点',
|
|
|
|
visibleOn: 'data.type == 3',
|
|
|
|
disabledOn: 'data.type == 3'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
label: 'Baidu',
|
2020-09-16 16:40:19 +08:00
|
|
|
actionType: 'url',
|
|
|
|
url: 'http://www.baidu.com?a=1&b=$test4'
|
2019-11-07 10:41:14 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'button',
|
|
|
|
actionType: 'ajax',
|
|
|
|
label: 'No Submit',
|
2020-09-16 16:40:19 +08:00
|
|
|
api: '/api/mock2/saveForm?waitSeconds=5'
|
2019-11-07 10:41:14 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'submit',
|
|
|
|
actionType: 'ajax',
|
|
|
|
label: 'Submit',
|
2020-09-16 16:40:19 +08:00
|
|
|
api: '/api/mock2/saveForm?waitSeconds=5'
|
2019-11-07 10:41:14 +08:00
|
|
|
}
|
|
|
|
]
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-11-07 10:41:14 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2019-04-30 11:11:25 +08:00
|
|
|
};
|