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

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

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

46 lines
984 B
JavaScript

export default {
type: 'page',
body: {
type: 'form',
api: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/saveForm',
title: '登录',
body: [
{
type: 'alert',
body: '阻止表单提交后的默认提示。',
level: 'info',
className: 'mb-1'
},
{
type: 'input-text',
name: 'name',
label: '姓名'
},
{
type: 'input-email',
name: 'email',
label: '邮箱'
}
],
onEvent: {
submitFail: {
actions: [
{
actionType: 'drawer',
drawer: {
title: '请求失败',
body: {
type: 'alert',
level: 'warning',
icon: 'fa fa-cloud',
body: '请求失败,若给您造成不便,敬请谅解。'
}
},
preventDefault: true
}
]
}
}
}
};