amis/examples/components/EventAction/update-data/UpdateInput.jsx
hsm-lv f1b383608b
fix:修复事件动作对禁用状态控制失效问题&更新文档示例 (#4278)
* fix:修复事件动作对禁用状态控制失效问题&更新文档示例

* fix:修复事件动作对禁用状态控制失效问题

* fix:修复事件动作对禁用状态控制失效问题
2022-05-10 19:31:20 +08:00

91 lines
1.7 KiB
JavaScript

export default {
type: 'page',
id: 'mypage',
data: {
globalData: {
myrole: '法官',
mymsg: '该吃饭了!',
title: 'beijing time'
}
},
body: [
{
type: 'alert',
body: '直接更新指定输入框的值。',
level: 'info',
className: 'mb-1'
},
{
type: 'button',
label: '更新输入框',
level: 'primary',
className: 'mt-2 mb-2',
onEvent: {
click: {
actions: [
{
actionType: 'setValue',
componentId: 'input_data_msg',
args: {
value: '我是amis!'
}
}
]
}
}
},
{
type: 'input-text',
label: '消息',
id: 'input_data_msg',
mode: 'horizontal',
name: 'mymsg'
},
{
type: 'button',
label: '更新表单内输入框',
level: 'primary',
className: 'mt-2 mb-2',
onEvent: {
click: {
actions: [
{
actionType: 'setValue',
componentId: 'input_data_role',
args: {
value: '预言家'
}
}
]
}
}
},
{
type: 'form',
title: '表单',
data: {
myrole: '杀手',
age: '18'
},
initApi: '/api/mock2/form/initData',
body: [
{
type: 'input-text',
id: 'input_data_role',
label: '角色',
name: 'myrole',
disabled: false,
mode: 'horizontal'
},
{
type: 'input-text',
label: '年龄',
name: 'age',
disabled: false,
mode: 'horizontal'
}
]
}
]
};