Repository: weilao/vue-swiper
Branch: master
Commit: 73857b2c8567
Files: 9
Total size: 34.2 KB
Directory structure:
gitextract_lm2yilr8/
├── .gitignore
├── LICENSE
├── README.md
├── demo/
│ └── index.html
├── dist/
│ └── vue-swiper.js
├── package.json
├── src/
│ ├── vue-swiper.less
│ └── vue-swiper.vue
└── webpack.config.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.idea
node_modules
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2016 威老
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
[](https://raw.githubusercontent.com/weilao/vue-swiper/master/LICENSE)
[](https://www.npmjs.com/package/vue-swiper)
[](https://github.com/weilao/vue-swiper/releases)
[](https://github.com/weilao/vue-swiper/issues)
[](https://github.com/weilao/vue-swiper)
[](https://nodei.co/npm/vue-swiper/)
# vue-swiper
Swiper component. Easy to use.
## Examples
[basic demo](http://weilao.github.io/vue-swiper/demo)
## Install
```
npm i vue-swiper -S
```
## Usage
```js
import Vue from 'vue'
import Swiper from 'vue-swiper'
new Vue({
el: 'body',
components: {Swiper},
methods: {
onSlideChangeStart (currentPage) {
console.log('onSlideChangeStart', currentPage);
},
onSlideChangeEnd (currentPage) {
console.log('onSlideChangeEnd', currentPage);
}
}
});
```
```html
Page 1
Page 2
Page 3
```
## Api
### Properties
| Name | Type | Default | Description |
|----------------------|-----------|--------------|--------------------------------------------------------------------|
| direction | `String` | `"vertical"` | Could be 'horizontal' or 'vertical' (for vertical slider). |
| mousewheel-control | `Boolean` | `true` | Set to true to enable navigation through slides using mouse wheel. |
| pagination-visible | `Boolean` | `false` | Toggle (hide/true) pagination container visibility when click on Slider's container |
| pagination-clickable | `Boolean` | `false` | If true then clicking on pagination button will cause transition to appropriate slide. |
| performace-mode | `Boolean` | `false` | Disable advance effect for better performance. |
| loop | `Boolean` | `false` | Set to true to enable continuous loop mode |
| ==================== | ========= | ============ | =================== |
### Methods
| Method | Description |
|-------------------|--------------------------|
| next() | Go next page. |
| prev() | Go previous page. |
| setPage(`Number`) | Set current page number. |
### Events
| Name | Parameters | Description |
|--------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| slide-change-start | `pageNumber` | Fire in the beginning of animation to other slide (next or previous). |
| slide-change-end | `pageNumber` | Will be fired after animation to other slide (next or previous). |
| slide-revert-start | `pageNumber` | Fire in the beginning of animation to revert slide (no change). |
| slide-revert-end | `pageNumber` | Will be fired after animation to revert slide (no change). |
| slider-move | `offset` | Callback function, will be executed when user touch and move finger over Swiper and move it. Receives swiper instance and 'touchmove' event as an arguments. |
| ================== | ================ | ============================ |
================================================
FILE: demo/index.html
================================================