mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-06 05:58:25 +08:00
40 lines
1.3 KiB
Markdown
40 lines
1.3 KiB
Markdown
|
### Carousel
|
||
|
|
||
|
轮播图
|
||
|
|
||
|
- `type` 请设置成 `carousel`
|
||
|
- `className` 外层 Dom 的类名
|
||
|
- `options` 轮播面板数据,默认`[]`,支持以下模式
|
||
|
- `image` 图片链接
|
||
|
- `label` 标签
|
||
|
- `html` HTML 自定义,同[Tpl](./Tpl.md)一致
|
||
|
- `auto` 是否自动轮播,默认`true`
|
||
|
- `interval` 切换动画间隔,默认`5s`
|
||
|
- `duration` 切换动画时长,默认`0.5s`
|
||
|
- `width` 宽度,默认`auto`
|
||
|
- `height` 高度,默认`200px`
|
||
|
- `controls` 显示左右箭头、底部圆点索引,默认`['dots', 'arrows']`
|
||
|
- `controlsTheme` 左右箭头、底部圆点索引颜色,默认`light`,另有`dark`模式
|
||
|
- `animation` 切换动画效果,默认`fade`,另有`slide`模式
|
||
|
|
||
|
```schema:height="350" scope="body"
|
||
|
{
|
||
|
"type": "carousel",
|
||
|
"controlTheme": "light",
|
||
|
"height": "300",
|
||
|
"animation": "slide",
|
||
|
"className": "b-info m-b-xxl",
|
||
|
"options": [
|
||
|
{
|
||
|
"image": "https://video-react.js.org/assets/poster.png"
|
||
|
},
|
||
|
{
|
||
|
"html": "<div style=\"width: 100%; height: 300px; background: #e3e3e3; text-align: center; line-height: 300px;\">carousel data</div>"
|
||
|
},
|
||
|
{
|
||
|
"image": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
```
|