amis2/examples/components/EventAction/cmpt-event-action/CarouselEvent.jsx
hsm-lv 4acfbb99ce
feat:优化动作数据域 (#5544)
* feat:优化事件数据域

* feat:优化事件数据域

* feat:优化事件数据域(option->item,options->items)

* feat:优化事件数据域(version)

* feat:优化事件数据域(修复弹窗事件多次触发&并行数据获取问题)

* feat:优化事件数据域(删除多余代码)

* feat:优化事件数据域(更新文档)

* feat:优化事件数据域(更新文档)

* feat:优化动作数据域

* feat:优化动作数据域
2022-10-12 15:09:03 +08:00

96 lines
2.0 KiB
JavaScript

export default {
type: 'page',
title: '轮播图组件事件',
regions: ['body', 'toolbar', 'header'],
data: {
index: 3
},
body: [
{
type: 'action',
label: '上一张',
level: 'primary',
className: 'mr-3 mb-3',
onEvent: {
click: {
actions: [
{
actionType: 'prev',
componentId: 'carousel_001'
}
]
}
}
},
{
type: 'action',
label: '下一张',
level: 'primary',
className: 'mr-3 mb-3',
onEvent: {
click: {
actions: [
{
actionType: 'next',
componentId: 'carousel_001'
}
]
}
}
},
{
type: 'action',
label: '滚动到第三张',
level: 'primary',
className: 'mr-3 mb-3',
onEvent: {
click: {
actions: [
{
actionType: 'goto-image',
componentId: 'carousel_001',
args: {
activeIndex: '${index}'
}
}
]
}
}
},
{
type: 'carousel',
id: 'carousel_001',
auto: false,
thumbMode: 'cover',
animation: 'slide',
height: 300,
options: [
{
image:
'https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png'
},
{
html: '<div style="width: 100%; height: 300px; background: #e3e3e3; text-align: center; line-height: 300px;">carousel data</div>'
},
{
thumbMode: 'contain',
image:
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg'
}
],
onEvent: {
change: {
actions: [
{
actionType: 'toast',
args: {
msg: '滚动至${activeIndex}'
}
}
]
}
}
}
]
};