vue-swiper
vue swiper for vue 2.0. light weight and simple
Examples
Install
npm install vue-light-swiper --save-dev
Usage
el: 'body' components: vueSwiper: VueSwipervueSwiper vueSwiperSlide: VueSwipervueSwiperSlide methods: { console; } ;
Page 1 Page 2 Page 3
Usage in ssr
;
Use lazyload
Api
Properties
Name | Type | Default | Description |
---|---|---|---|
showIndex | Number |
0 |
Set the swiper item show index, can use .sync modifier. |
auto | Number |
0 |
Set the swiper autoplay interval time, unit ms. |
defaultDuration | Number |
300 |
Set the swiper defaultDuration for transitionDuration, unit ms. |
loop | Boolean |
false |
Set whether you need swiper loop. |
vertical | Boolean |
false |
Set whether you need a vertical swiper. |
indicators | Boolean |
false |
Set whether you need indicators. |
limit | Number |
20 |
Set the limit of swiper slide change, unit px. |
uselazyload | Boolean |
false |
Set whether use lazyload. |
preload | Number |
0 |
Set lazyload preload number. |
baseWidth | Number |
0 |
Set swiper base width, unit px. (default width is swiper's width, but when you init a swiper with invisible, default width can not be set right, you need set base width in this time.) |
baseHeight | Number |
0 |
Set swiper base height, unit px. (need when vertical, default height is swiper's height, but when you init a swiper with invisible, default height can not be set right, you need set base height in this time.) |
baseSizeDom | String、dom |
`` | Set swiper base width and height with a dom or a selector.(priority is lower than baseWidth and baseHeight) |
Events
Name | Parameters | Description |
---|---|---|
slide-change | index, oldIndex |
Fire when the slide changed . |
slide-end | index |
Fire when the slide animation end . |
License
Copyright (c) 2017-present, zhengjiaqi