0.5.0 • Published 9 years ago

vue-swiper v0.5.0

Weekly downloads
342
License
MIT
Repository
github
Last release
9 years ago

npm npm GitHub release GitHub issues GitHub stars

NPM

vue-swiper

Swiper component. Easy to use.

Examples

basic demo

webpack ES2015 demo

Install

npm i vue-swiper -S

Usage

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);
        }
    }
});
<swiper v-ref:swiper
        direction="horizontal"
        :mousewheel-control="true"
        :performance-mode="false"
        :pagination-visible="true"
        :pagination-clickable="true"
        :loop=“true”
        @slide-change-start="onSlideChangeStart"
        @slide-change-end="onSlideChangeEnd">
    <div>Page 1</div>
    <div>Page 2</div>
    <div>Page 3</div>
</swiper>

Api

Properties

NameTypeDefaultDescription
directionString"vertical"Could be 'horizontal' or 'vertical' (for vertical slider).
mousewheel-controlBooleantrueSet to true to enable navigation through slides using mouse wheel.
pagination-visibleBooleanfalseToggle (hide/true) pagination container visibility when click on Slider's container
pagination-clickableBooleanfalseIf true then clicking on pagination button will cause transition to appropriate slide.
performace-modeBooleanfalseDisable advance effect for better performance.
loopBooleanfalseSet to true to enable continuous loop mode
============================================================

Methods

MethodDescription
next()Go next page.
prev()Go previous page.
setPage(Number)Set current page number.

Events

NameParametersDescription
slide-change-startpageNumberFire in the beginning of animation to other slide (next or previous).
slide-change-endpageNumberWill be fired after animation to other slide (next or previous).
slide-revert-startpageNumberFire in the beginning of animation to revert slide (no change).
slide-revert-endpageNumberWill be fired after animation to revert slide (no change).
slider-moveoffsetCallback function, will be executed when user touch and move finger over Swiper and move it. Receives swiper instance and 'touchmove' event as an arguments.
==============================================================
0.5.0

9 years ago

0.4.0

9 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago