amis/examples/components/Tabs/Normal.jsx

241 lines
4.7 KiB
React
Raw Normal View History

2019-04-30 11:11:25 +08:00
export default {
2019-11-07 10:41:14 +08:00
type: 'page',
title: '选项卡示例',
subTitle: '所有选项卡都在当前页面中包括默认、line、card以及radio模式',
body: [
{
type: 'tabs',
tabs: [
2019-04-30 11:11:25 +08:00
{
2019-11-07 10:41:14 +08:00
title: '选项卡1',
hash: 'tab1',
body: '选项卡内容1'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
2019-04-30 11:11:25 +08:00
{
2019-11-07 10:41:14 +08:00
title: '选项卡2',
hash: 'tab2',
body: {
type: 'form',
panelClassName: 'panel-primary',
body: [
2019-11-07 10:41:14 +08:00
{
type: 'input-text',
2019-11-07 10:41:14 +08:00
name: 'a',
label: '文本'
}
]
}
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
{
title: '选项卡3',
body: {
type: 'crud',
api: '/api/sample',
filter: {
title: '条件搜索',
submitText: '',
body: [
2019-04-30 11:11:25 +08:00
{
type: 'input-text',
2019-11-07 10:41:14 +08:00
name: 'keywords',
placeholder: '通过关键字搜索',
clearable: true,
addOn: {
label: '搜索',
type: 'submit'
}
2019-04-30 11:11:25 +08:00
},
{
2019-11-07 10:41:14 +08:00
type: 'plain',
text: '这里的表单项可以配置多个'
2019-04-30 11:11:25 +08:00
}
2019-11-07 10:41:14 +08:00
]
},
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: []
}
2019-04-30 11:11:25 +08:00
]
2019-11-07 10:41:14 +08:00
}
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'line',
tabs: [
2019-04-30 11:11:25 +08:00
{
2019-11-07 10:41:14 +08:00
title: '选项卡1',
body: '选项卡内容1'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
{
title: '选项卡2',
body: '选项卡内容2'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
2019-04-30 11:11:25 +08:00
{
2019-11-07 10:41:14 +08:00
title: '选项卡3',
body: '选项卡内容3'
}
]
},
{
type: 'divider'
},
{
type: 'tabs',
mode: 'card',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
2019-04-30 11:11:25 +08:00
{
2019-11-07 10:41:14 +08:00
title: '选项卡2',
body: '选项卡内容2'
},
2019-04-30 11:11:25 +08:00
2019-11-07 10:41:14 +08:00
{
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'
},
2019-11-07 10:41:14 +08:00
{
type: 'tabs',
mode: 'radio',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
2019-04-30 11:11:25 +08:00
2019-11-07 10:41:14 +08:00
{
title: '选项卡2',
body: '选项卡内容2'
2019-04-30 11:11:25 +08:00
},
2019-11-07 10:41:14 +08:00
{
title: '选项卡3',
body: '选项卡内容3'
}
]
2020-10-28 23:32:33 +08:00
},
{
type: 'divider'
},
2020-12-17 12:27:21 +08:00
{
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'
},
2020-10-28 23:32:33 +08:00
{
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'
}
]
2019-11-07 10:41:14 +08:00
}
]
};