## Swipe ### Install ``` javascript import { Swipe, SwipeItem } from 'vant'; Vue.component(Swipe.name, Swipe); Vue.component(SwipeItem.name, SwipeItem); ``` ### Usage #### Basic Usage Use `autoplay` prop to set autoplay interval :::demo Basic Usage ```html 1 2 3 4 ``` ::: #### Image Lazyload Use [Lazyload](#/zh-CN/component/lazyload) component to lazyload image :::demo Image Lazyload ```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 | Autoplay interval (ms) | `Number` | - | - | | duration | Animation duration (ms) | `Number` | `500` | - | | showIndicators | Whether to show indocators | `Boolean` | `true` | - | | initialSwipe | Index of initial swipe, start from 0 | `Number` | `0` | - | ### Event | Event | Description | Attribute | |-----------|-----------|-----------| | change | Triggered when current swipe change | index: index of current swipe |