mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 15:19:58 +08:00
77b78a9389
* Unify name of ReactNode type in document * Lowser all string type name * Lowercase all number type name * Lowercase all boolean type name * Unify array type * Lowercase all object type name * Unify mutilple types
40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
---
|
||
category: Components
|
||
type: Data Display
|
||
title: Carousel
|
||
subtitle: 走马灯
|
||
---
|
||
|
||
旋转木马,一组轮播的区域。
|
||
|
||
## 何时使用
|
||
|
||
- 当有一组平级的内容。
|
||
- 当内容空间不足时,可以用走马灯的形式进行收纳,进行轮播展现。
|
||
- 常用于一组图片或卡片轮播。
|
||
|
||
## API
|
||
|
||
| 参数 | 说明 | 类型 | 默认值 |
|
||
|------------------|----------------------------------------------|----------|---------------------------------|
|
||
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx |
|
||
| dots | 是否显示面板指示点 | boolean | true |
|
||
| vertical | 垂直显示 | boolean | false |
|
||
| autoplay | 是否自动切换 | boolean | false |
|
||
| easing | 动画效果 | string | linear |
|
||
| beforeChange | 切换面板的回调 | function(from, to) | 无
|
||
| afterChange | 切换面板的回调 | function(current) | 无
|
||
|
||
更多参数可参考:https://github.com/akiran/react-slick
|
||
|
||
<style>
|
||
.ant-carousel .slick-slide {
|
||
text-align: center;
|
||
height: 160px;
|
||
line-height: 130px;
|
||
background: #506b9e;
|
||
color: #fff;
|
||
overflow: hidden;
|
||
}
|
||
</style>
|