## Swipe
### Install
``` javascript
import { Swipe, SwipeItem } from 'vant';
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
```
### Usage
#### Basic Usage
通过`autoplay`属性设置自动轮播间隔
:::demo Basic Usage
```html
1
2
3
4
```
:::
#### 图片懒加载
配合 [Lazyload](#/zh-CN/component/lazyload) 组件实现图片懒加载
:::demo 图片懒加载
```html
```
```javascript
export default {
data() {
return {
images: [
'https://img.yzcdn.cn/1.jpg',
'https://img.yzcdn.cn/2.jpg'
]
}
}
}
```
:::
### API
| Attribute | Description | Type | Default | Accepted Values |
|-----------|-----------|-----------|-------------|-------------|
| autoplay | 自动轮播间隔,单位为 ms | `Number` | - | - |
| duration | 动画时长,单位为 ms | `Number` | `500` | - |
| showIndicators | 是否显示指示器 | `Boolean` | `true` | - |
### 事件
| Event | Description | Attribute |
|-----------|-----------|-----------|
| change | 每一页轮播结束后触发 | index, 当前页的索引 |