mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 09:21:13 +08:00
65ac422ed6
* 补充容错 * fix: form 中 name 关联顶层数据初始化失效 * 更新 examples * 文档调整 * 删除多余的文档, 调整 schema * schema 调整 * schema 调整 * control 类型容器 control 改成 body * 修复一个选项加载的bug * form 注册直接用 type
142 lines
3.1 KiB
JavaScript
142 lines
3.1 KiB
JavaScript
export default {
|
|
title: '表单向导',
|
|
body: [
|
|
{
|
|
type: 'wizard',
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2',
|
|
initApi: '/api/mock2/form/initData?waitSeconds=2',
|
|
steps: [
|
|
{
|
|
title: '第一步',
|
|
body: [
|
|
{
|
|
name: 'website',
|
|
label: '网址',
|
|
type: 'input-url',
|
|
required: true
|
|
},
|
|
{
|
|
name: 'name',
|
|
label: '名称',
|
|
type: 'input-text',
|
|
required: true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
title: 'Step 2',
|
|
body: [
|
|
{
|
|
name: 'email2',
|
|
label: '邮箱',
|
|
type: 'input-email',
|
|
required: true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
title: 'Step 3',
|
|
body: ['这是最后一步了']
|
|
}
|
|
]
|
|
},
|
|
{
|
|
type: 'wizard',
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2',
|
|
mode: 'vertical',
|
|
steps: [
|
|
{
|
|
title: '第一步',
|
|
body: [
|
|
{
|
|
name: 'website',
|
|
label: '网址',
|
|
type: 'input-url',
|
|
required: true
|
|
},
|
|
{
|
|
name: 'email',
|
|
label: '邮箱',
|
|
type: 'input-email',
|
|
required: true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
title: 'Step 2',
|
|
body: [
|
|
{
|
|
name: 'email2',
|
|
label: '邮箱',
|
|
type: 'input-email',
|
|
required: true
|
|
}
|
|
]
|
|
},
|
|
{
|
|
title: 'Step 3',
|
|
body: ['这是最后一步了']
|
|
}
|
|
]
|
|
},
|
|
{
|
|
type: 'wizard',
|
|
steps: [
|
|
{
|
|
title: '第一步',
|
|
body: [
|
|
{
|
|
name: 'website',
|
|
label: '网址',
|
|
type: 'input-url',
|
|
required: true
|
|
},
|
|
{
|
|
name: 'email',
|
|
label: '邮箱',
|
|
type: 'input-email',
|
|
required: true
|
|
}
|
|
],
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2'
|
|
},
|
|
{
|
|
title: '第二步',
|
|
body: [
|
|
{
|
|
name: 'test1',
|
|
type: 'input-email',
|
|
label: 'Email',
|
|
value: 'test@test.com'
|
|
},
|
|
{
|
|
type: 'divider'
|
|
},
|
|
{
|
|
type: 'input-text',
|
|
name: 'test2',
|
|
label: '必填示例',
|
|
required: true
|
|
},
|
|
{
|
|
type: 'divider'
|
|
},
|
|
{
|
|
type: 'input-text',
|
|
name: 'test3',
|
|
placeholder: '可选'
|
|
}
|
|
],
|
|
initApi: '/api/mock2/form/initForm',
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2'
|
|
},
|
|
{
|
|
title: '确定',
|
|
body: ['最后一步了,确认要提交吗?'],
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
};
|