npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue2-swiper

v0.0.13

Published

一个简单的vue2.x swiper插件

Downloads

304

Readme

vue2-swiper

一个简单的vue2 swiper 插件

Getting start

NPM

npm install --save vue2-swiper
import {Swiper} from 'vue2-swiper'

new Vue({
    el: '#app',
    components: {
        Swiper
    }
})
<swiper>
<div v-for="n in 3">page {{n}}</div>
</swiper>

or you can import vue2Swiper in main.js

import Vue from 'vue'
import vue2Swiper from 'vue2-swiper'
Vue.use(vue2Swiper)

HTML

<script type="text/javascript" src="path/to/vue.js"></script>
<script type="text/javascript" src="path/to/vue2Swiper.js"></script>
<script>
Vue.use(vue2Swiper)
var vm = new Vue({
  el: '#app'
 })
</script>

Demo & Document

  • git clone https://github.com/fchengjin/vue2-swiper
  • cd vue2-swiper
  • npm install
  • npm run dev
  • it will open the demo at 127.0.0.1:3030
  • or you can see the DEMO here

Api

props

| Name | Type | Default | Description | |----------------------|-----------|--------------|--------------------------------------------------------------------| | direction | String | "horizontal" | Could be 'horizontal' or 'vertical' (for vertical slider). | | mousewheel-control | Boolean | false | 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 true to enable the loop mode | | speed | Boolean | 500 | swiper switching speed | | active-index | Number | 1 | The active page when initializing | | no-bounds | Boolean | false | If you want the first page can not slide to left ,or the last page can not slide to right , you should set noBounds to true. | | forbidden-slide | Boolean | false | If true, you can not change the swiper by sliding | | tab-mode | Array | - | f you set tabMode , it will add a tabnav above the swiper-slider. | | tab-mode-animation | Boolean | false | If you just use the tab as a nav, you can set tabModeAnimation to true. | | customize-nav | String | -| customize-nav is a dom selector, you can place it anywhere you want. | | customize-nav-active-class | String | active | customize-nav-active-class | | nested | Boolean | false | f you want nest the swiper , you should add nested property to the children |

Methods

| Method | Description | |-------------------|--------------------------| | next() | switch to next slider | | prev() | switch to previous slider | | setPage(pageNumber : Number,noAnimation : Boolean) | NoAnimation is optional parameter, if set true, there is no transition animation when switching|

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. |