1.0.3 • Published 6 years ago

vue-pc-swipe v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

vue-pc-swipe

Build Status npm npm npm npm

Overview

A lightweight vue swipe component that making the slides fade work in pc.

demo

Install

Install vue-pc-swipe

npm install vue-pc-swipe

Import vue-pc-swipe

ES6/commonjs import style is supported.

// ES6
import {Swipe, SwipeItem} from 'vue-pc-swipe';

// commonjs
var Swipe = require("vue-pc-swipe").Swipe;
var SwipeItem = require("vue-pc-swipe").SwipeItem;

Usage

<swipe ref="myPcSwipe" :continuous="true" :auto="5000" :startSlide="3" @change="chageSwipe">
  <swipe-item>
    <div>slide0</div>
  </swipe-item>
  <swipe-item>
    <div>slide1</div>
  </swipe-item>
  <swipe-item>
    <div>slide2</div>
  </swipe-item>
</swipe>

expand

you can use change function add indicators、prev or next button.demo

options

Attributes

OptionDescription
continuousBoolean(default: true) create an infinite feel with no endpoints
autoNumber(default: 5000) speed of prev and next transitions in milliseconds
startSlideNumber(defalut: 0) index position Swipe should start at

Events

OptionDescription
prev()slide to prev
next()slide to next
getPos()returns current slide index position
getNumSlides()returns the total amount of slides
slide(index)slide to set index position
change(index)runs at slide change, index is the current slide index position

LICENSE

MIT@PLDaily

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago