Skip to content

Muxi-Studio/vue-finger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-finger

Vue plugin for supporting touch gesture. Support Vue 2.0+.

Gesture supported:

  • Swipe
  • SwipeMove
  • Pinch
  • Tap
  • Double Tap

Install

npm install vue-finger --save

Usage

import vueFinger from "vue-finger"

Vue.use(vueFinger)

in your component

<template>
  <div  v-finger:swipe="this.bar">
      swipe!
  </div>
</template>


<script>
···
methods:{
    bar(e){
      console.log("swipe", e.direction)
    }
 },
···
</script>

Event

Swipe

e.direction

the direction of the swipe: "Left", "Right", "Up", "Down".

e.deltaX

the delta on X axis of the whole swipe.

e.deltaY

the delta on Y axis of the whole swipe.

SwipeMove

e.direction

the direction of the swipe: "Left", "Right", "Up", "Down".

e.distenceX

the cumulate distence on X axis of the swipe.

e.distenceY

the cumulate distence on Y axis of the swipe.

Pinch

e.customScale

the difference value between latest scale and last scale

Tap

no custom event props

doubleTap

no custom event props

Contributors

Lisence

DWTFYW

About

Vue plugin for supporting touch gesture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published