2019-06-04 20:13:40 +08:00
|
|
|
## Carousel
|
2019-05-16 16:31:20 +08:00
|
|
|
|
|
|
|
轮播图
|
|
|
|
|
2019-12-24 11:25:55 +08:00
|
|
|
- `type` 请设置成 `carousel`
|
|
|
|
- `className` 外层 Dom 的类名
|
|
|
|
- `options` 轮播面板数据,默认`[]`,支持以下模式
|
|
|
|
- 图片
|
|
|
|
- `image` 图片链接
|
|
|
|
- `imageClassName` 图片类名
|
|
|
|
- `title` 图片标题
|
|
|
|
- `titleClassName` 图片标题类名
|
|
|
|
- `description` 图片描述
|
|
|
|
- `descriptionClassName` 图片描述类名
|
|
|
|
- `html` HTML 自定义,同[Tpl](./Tpl.md)一致
|
|
|
|
- `itemSchema` 自定义`schema`来展示数据
|
|
|
|
- `auto` 是否自动轮播,默认`true`
|
|
|
|
- `interval` 切换动画间隔,默认`5s`
|
|
|
|
- `duration` 切换动画时长,默认`0.5s`
|
|
|
|
- `width` 宽度,默认`auto`
|
|
|
|
- `height` 高度,默认`200px`
|
|
|
|
- `controls` 显示左右箭头、底部圆点索引,默认`['dots', 'arrows']`
|
|
|
|
- `controlsTheme` 左右箭头、底部圆点索引颜色,默认`light`,另有`dark`模式
|
|
|
|
- `animation` 切换动画效果,默认`fade`,另有`slide`模式
|
2019-05-16 16:31:20 +08:00
|
|
|
|
|
|
|
```schema:height="350" scope="body"
|
|
|
|
{
|
|
|
|
"type": "carousel",
|
|
|
|
"controlTheme": "light",
|
|
|
|
"height": "300",
|
|
|
|
"animation": "slide",
|
|
|
|
"options": [
|
|
|
|
{
|
2019-12-24 11:25:55 +08:00
|
|
|
"image": "https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png"
|
2019-05-16 16:31:20 +08:00
|
|
|
},
|
|
|
|
{
|
2019-06-14 11:17:54 +08:00
|
|
|
"html": "<div style=\"width: 100%; height: 300px; background: #e3e3e3; text-align: center; line-height: 300px;\">carousel data</div>"
|
2019-05-16 16:31:20 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"image": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|