amis2/examples/components/EventAction/TabsEvent.jsx
2022-02-15 10:38:03 +08:00

96 lines
1.9 KiB
JavaScript

export default {
type: 'page',
title: '标签页组件事件',
regions: ['body', 'toolbar', 'header'],
body: [
{
name: 'trigger1',
id: 'trigger1',
type: 'action',
label: '选项卡1',
level: 'primary',
className: 'mr-3 mb-3',
onEvent: {
click: {
actions: [
{
actionType: 'changeActiveKey',
componentId: 'tabs-change-receiver',
activeKey: 0
}
]
}
}
},
{
name: 'trigger2',
id: 'trigger2',
type: 'action',
label: '选项卡2',
level: 'primary',
className: 'mr-3 mb-3',
onEvent: {
click: {
actions: [
{
actionType: 'changeActiveKey',
componentId: 'tabs-change-receiver',
activeKey: 1
}
]
}
}
},
{
name: 'trigger3',
id: 'trigger3',
type: 'action',
label: '选项卡3',
level: 'primary',
className: 'mr-3 mb-3',
onEvent: {
click: {
actions: [
{
actionType: 'changeActiveKey',
componentId: 'tabs-change-receiver',
activeKey: 2
}
]
}
}
},
{
name: 'tabs-change-receiver',
id: 'tabs-change-receiver',
type: 'tabs',
mode: 'line',
tabs: [
{
title: '选项卡1',
body: '选项卡内容1'
},
{
title: '选项卡2',
body: '选项卡内容2'
},
{
title: '选项卡3',
body: '选项卡内容3'
}
],
onEvent: {
change: {
actions: [
{
actionType: 'toast',
msgType: 'info',
msg: '派发change事件'
}
]
}
}
}
]
};