├── .gitignore
├── LICENSE
├── README.md
├── demo
└── index.html
├── dist
└── vue-swiper.js
├── package.json
├── src
├── vue-swiper.less
└── vue-swiper.vue
└── webpack.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | node_modules
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 威老
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://raw.githubusercontent.com/weilao/vue-swiper/master/LICENSE)
2 | [](https://www.npmjs.com/package/vue-swiper)
3 | [](https://github.com/weilao/vue-swiper/releases)
4 | [](https://github.com/weilao/vue-swiper/issues)
5 | [](https://github.com/weilao/vue-swiper)
6 |
7 | [](https://nodei.co/npm/vue-swiper/)
8 |
9 | # vue-swiper
10 | Swiper component. Easy to use.
11 |
12 | ## Examples
13 | [basic demo](http://weilao.github.io/vue-swiper/demo)
14 |
15 | ## Install
16 | ```
17 | npm i vue-swiper -S
18 | ```
19 |
20 | ## Usage
21 |
22 | ```js
23 | import Vue from 'vue'
24 | import Swiper from 'vue-swiper'
25 |
26 | new Vue({
27 | el: 'body',
28 | components: {Swiper},
29 | methods: {
30 | onSlideChangeStart (currentPage) {
31 | console.log('onSlideChangeStart', currentPage);
32 | },
33 | onSlideChangeEnd (currentPage) {
34 | console.log('onSlideChangeEnd', currentPage);
35 | }
36 | }
37 | });
38 | ```
39 |
40 | ```html
41 |
50 |
Page 1
51 |
Page 2
52 |
Page 3
53 |
54 | ```
55 |
56 | ## Api
57 | ### Properties
58 | | Name | Type | Default | Description |
59 | |----------------------|-----------|--------------|--------------------------------------------------------------------|
60 | | direction | `String` | `"vertical"` | Could be 'horizontal' or 'vertical' (for vertical slider). |
61 | | mousewheel-control | `Boolean` | `true` | Set to true to enable navigation through slides using mouse wheel. |
62 | | pagination-visible | `Boolean` | `false` | Toggle (hide/true) pagination container visibility when click on Slider's container |
63 | | pagination-clickable | `Boolean` | `false` | If true then clicking on pagination button will cause transition to appropriate slide. |
64 | | performace-mode | `Boolean` | `false` | Disable advance effect for better performance. |
65 | | loop | `Boolean` | `false` | Set to true to enable continuous loop mode |
66 | | ==================== | ========= | ============ | =================== |
67 |
68 | ### Methods
69 | | Method | Description |
70 | |-------------------|--------------------------|
71 | | next() | Go next page. |
72 | | prev() | Go previous page. |
73 | | setPage(`Number`) | Set current page number. |
74 |
75 | ### Events
76 | | Name | Parameters | Description |
77 | |--------------------|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
78 | | slide-change-start | `pageNumber` | Fire in the beginning of animation to other slide (next or previous). |
79 | | slide-change-end | `pageNumber` | Will be fired after animation to other slide (next or previous). |
80 | | slide-revert-start | `pageNumber` | Fire in the beginning of animation to revert slide (no change). |
81 | | slide-revert-end | `pageNumber` | Will be fired after animation to revert slide (no change). |
82 | | 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. |
83 | | ================== | ================ | ============================ |
84 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |