amis/examples/components/Tabs/Normal.jsx
liaoxuezhi 65ac422ed6
1.2.x 文档&示例配置调整 (#2064)
* 补充容错

* fix: form 中 name 关联顶层数据初始化失效

* 更新 examples

* 文档调整

* 删除多余的文档, 调整 schema

* schema 调整

* schema 调整

* control 类型容器 control 改成 body

* 修复一个选项加载的bug

* form 注册直接用 type
2021-06-07 10:09:55 +08:00

241 lines
4.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export default {
type: 'page',
title: '选项卡示例',
subTitle: '所有选项卡都在当前页面中包括默认、line、card以及radio模式',
body: [
{
type: 'tabs',
tabs: [
{
title: '选项卡1',
hash: 'tab1',
body: '选项卡内容1'
},
{
title: '选项卡2',
hash: 'tab2',
body: {
type: 'form',
panelClassName: 'panel-primary',
body: [
{
type: 'input-text',
name: 'a',
label: '文本'
}
]
}
},
{
title: '选项卡3',
body: {
type: 'crud',
api: '/api/sample',
filter: {
title: '条件搜索',
submitText: '',
body: [
{
type: 'input-text',
name: 'keywords',
placeholder: '通过关键字搜索',
clearable: true,
addOn: {
label: '搜索',
type: 'submit'
}
},
{
type: 'plain',
text: '这里的表单项可以配置多个'
}
]
},
columns: [
{
name: 'id',
label: 'ID',
width: 20
},
{
name: 'engine',
label: 'Rendering engine'
},
{
name: 'browser',
label: 'Browser'
},
{
name: 'platform',
label: 'Platform(s)'
},
{
name: 'version',
label: 'Engine version'
},
{
name: 'grade',
label: 'CSS grade'
},
{
type: 'operation',
label: '操作',
width: 100,
buttons: []
}
]
}
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'line',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'card',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'chrome',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'radio',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'tiled',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
},
{
title: '选项卡4',
body: '选项卡内容4',
icon: 'fa fa-flag',
iconPosition: 'right'
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'vertical',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
},
{
title: '选项卡4',
body: '选项卡内容4'
},
{
title: '选项卡5',
body: '选项卡内容5'
}
]
}
]
};