Vue plugin for supporting touch gesture. Support Vue 2.0+.
Gesture supported:
- Swipe
- SwipeMove
- Pinch
- Tap
- Double Tap
npm install vue-finger --save
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>
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.
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.
e.customScale
the difference value between latest scale and last scale
no custom event props
no custom event props
DWTFYW