mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-16 01:40:53 +08:00
65ac422ed6
* 补充容错 * fix: form 中 name 关联顶层数据初始化失效 * 更新 examples * 文档调整 * 删除多余的文档, 调整 schema * schema 调整 * schema 调整 * control 类型容器 control 改成 body * 修复一个选项加载的bug * form 注册直接用 type
203 lines
5.7 KiB
JavaScript
203 lines
5.7 KiB
JavaScript
export default {
|
|
title: 'Tabs 示例',
|
|
body: [
|
|
{
|
|
type: 'form',
|
|
mode: 'horizontal',
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2',
|
|
title: '',
|
|
actions: [
|
|
{
|
|
type: 'button',
|
|
actionType: 'dialog',
|
|
label: '弹框中的 Tabs',
|
|
level: 'info',
|
|
dialog: {
|
|
title: '',
|
|
// size: "md",
|
|
body: {
|
|
type: 'form',
|
|
mode: 'horizontal',
|
|
horizontal: {
|
|
leftFixed: 'xs'
|
|
},
|
|
api: '/api/mock2/form/saveForm?waitSeconds=2',
|
|
actions: [
|
|
{
|
|
type: 'submit',
|
|
label: '提交',
|
|
primary: true
|
|
}
|
|
],
|
|
body: [
|
|
{
|
|
type: 'tabs',
|
|
tabs: [
|
|
{
|
|
title: '基本信息',
|
|
body: [
|
|
{
|
|
type: 'group',
|
|
body: [
|
|
{
|
|
type: 'input-email',
|
|
name: 'email1',
|
|
placeholder: '请输入邮箱地址',
|
|
label: '邮箱'
|
|
},
|
|
{
|
|
type: 'input-password',
|
|
name: 'password',
|
|
placeholder: '密码',
|
|
label: false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
type: 'divider'
|
|
},
|
|
{
|
|
type: 'group',
|
|
body: [
|
|
{
|
|
type: 'input-email',
|
|
name: 'email2',
|
|
placeholder: '请输入邮箱地址',
|
|
label: '邮箱'
|
|
},
|
|
{
|
|
type: 'checkbox',
|
|
name: 'rememberMe',
|
|
label: false,
|
|
option: '记住我'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
title: '其他信息',
|
|
body: [
|
|
{
|
|
type: 'input-email',
|
|
name: 'email3',
|
|
placeholder: '请输入邮箱地址',
|
|
label: '邮箱'
|
|
},
|
|
{
|
|
type: 'divider'
|
|
},
|
|
{
|
|
type: 'checkbox',
|
|
name: 'rememberMe2',
|
|
option: '记住我'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type: 'submit',
|
|
label: '提交',
|
|
primary: true
|
|
}
|
|
],
|
|
body: [
|
|
{
|
|
type: 'tabs',
|
|
name: 'outertabs',
|
|
className: 'm-b',
|
|
tabs: [
|
|
{
|
|
title: '基本信息',
|
|
hash: 'tab1',
|
|
body: [
|
|
{
|
|
type: 'group',
|
|
body: [
|
|
{
|
|
type: 'input-email',
|
|
name: 'email',
|
|
placeholder: '请输入邮箱地址',
|
|
label: '邮箱'
|
|
},
|
|
{
|
|
type: 'input-password',
|
|
name: 'password',
|
|
placeholder: '密码',
|
|
label: false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
type: 'divider'
|
|
},
|
|
{
|
|
type: 'group',
|
|
body: [
|
|
{
|
|
type: 'input-email',
|
|
name: 'email2',
|
|
placeholder: '请输入邮箱地址',
|
|
label: '邮箱'
|
|
},
|
|
{
|
|
type: 'checkbox',
|
|
name: 'rememberMe',
|
|
label: false,
|
|
option: '记住我'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
title: '其他信息',
|
|
hash: 'tab2',
|
|
body: [
|
|
{
|
|
type: 'input-email',
|
|
name: 'email3',
|
|
placeholder: '请输入邮箱地址',
|
|
label: '邮箱'
|
|
},
|
|
{
|
|
type: 'divider'
|
|
},
|
|
{
|
|
type: 'checkbox',
|
|
name: 'rememberMe4',
|
|
label: '记住我'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
|
|
{
|
|
type: 'radios',
|
|
name: 'outertabs',
|
|
label: 'Tabs值',
|
|
mode: 'normal',
|
|
description:
|
|
'如果 tabs 设置了 name 是可以跟表单值联动的,默认并不会开启此功能。',
|
|
options: [
|
|
{
|
|
label: '基本信息',
|
|
value: '基本信息'
|
|
},
|
|
{
|
|
label: '其他信息',
|
|
value: '其他信息'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
};
|