amis2/examples/components/Wizard.jsx

142 lines
3.1 KiB
React
Raw Normal View History

2019-04-30 11:11:25 +08:00
export default {
2019-11-07 10:41:14 +08:00
title: '表单向导',
body: [
{
type: 'wizard',
api: '/api/mock2/form/saveForm?waitSeconds=2',
initApi: '/api/mock2/form/initData?waitSeconds=2',
steps: [
2019-04-30 11:11:25 +08:00
{
2019-11-07 10:41:14 +08:00
title: '第一步',
body: [
2019-11-07 10:41:14 +08:00
{
name: 'website',
label: '网址',
type: 'input-url',
2019-11-07 10:41:14 +08:00
required: true
},
{
name: 'name',
label: '名称',
type: 'input-text',
2019-11-07 10:41:14 +08:00
required: true
}
]
2019-04-30 11:11:25 +08:00
},
{
2019-11-07 10:41:14 +08:00
title: 'Step 2',
body: [
2019-11-07 10:41:14 +08:00
{
name: 'email2',
label: '邮箱',
type: 'input-email',
2019-11-07 10:41:14 +08:00
required: true
}
]
2019-04-30 11:11:25 +08:00
},
{
2019-11-07 10:41:14 +08:00
title: 'Step 3',
body: ['这是最后一步了']
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
]
},
{
type: 'wizard',
api: '/api/mock2/form/saveForm?waitSeconds=2',
mode: 'vertical',
steps: [
{
title: '第一步',
body: [
2019-11-07 10:41:14 +08:00
{
name: 'website',
label: '网址',
type: 'input-url',
2019-11-07 10:41:14 +08:00
required: true
},
{
name: 'email',
label: '邮箱',
type: 'input-email',
2019-11-07 10:41:14 +08:00
required: true
}
]
},
{
title: 'Step 2',
body: [
2019-11-07 10:41:14 +08:00
{
name: 'email2',
label: '邮箱',
type: 'input-email',
2019-11-07 10:41:14 +08:00
required: true
}
]
},
{
title: 'Step 3',
body: ['这是最后一步了']
2019-11-07 10:41:14 +08:00
}
]
},
{
type: 'wizard',
steps: [
{
title: '第一步',
body: [
2019-11-07 10:41:14 +08:00
{
name: 'website',
label: '网址',
type: 'input-url',
2019-11-07 10:41:14 +08:00
required: true
},
{
name: 'email',
label: '邮箱',
type: 'input-email',
2019-11-07 10:41:14 +08:00
required: true
}
],
api: '/api/mock2/form/saveForm?waitSeconds=2'
},
{
title: '第二步',
body: [
2019-11-07 10:41:14 +08:00
{
name: 'test1',
type: 'input-email',
2019-11-07 10:41:14 +08:00
label: 'Email',
value: 'test@test.com'
},
{
type: 'divider'
},
{
type: 'input-text',
2019-11-07 10:41:14 +08:00
name: 'test2',
label: '必填示例',
required: true
},
{
type: 'divider'
},
{
type: 'input-text',
2019-11-07 10:41:14 +08:00
name: 'test3',
placeholder: '可选'
}
],
initApi: '/api/mock2/form/initForm',
api: '/api/mock2/form/saveForm?waitSeconds=2'
},
{
title: '确定',
body: ['最后一步了,确认要提交吗?'],
2019-11-07 10:41:14 +08:00
api: '/api/mock2/form/saveForm?waitSeconds=2'
}
]
}
]
};