v-touch
A full-featured gesture component designed for Vue
This module is still working in progress right now, so it is just for placeholder.
Now, you can try to use v-touch
in your project!
Usage
A deadly simply example:
If you are also working with vue-touch
, you can use Vue.use(VTouch, {name: 'move'})
(or something else), so that the directive name will change to v-move
!
el: '#app'template: `<div class="container">tap: {{ tapNum }},<br>dblTap: {{ dblTapNum }},<br>mltTap: {{ mltTapNum }}, lastMltTapped: {{ lastMltTapped }}<br>press: {{ pressNum }},<br>swipeLeft: {{ swipeLeftNum }},<br>swipeRight: {{ swipeRightNum }},<br>swipeUp: {{ swipeUpNum }},<br>swipeDown: {{ swipeDownNum }}<br><div v-touch="touch" @dblclick="dblclickOuter"><button class="my-btn" @tap="click">{{ msg }}</button><div @dblclick="dblclick"><button class="my-btn">Just Another Button</button></div></div><br><br><button class="btn btn-default" @click="toggle('x')">toggle x ({{ x }})</button><button class="btn btn-default" @click="toggle('y')">toggle y ({{ y }})</button></div>`{returnmsg: 'try to touch, move, swipe, press me!'x: falsey: falsetapNum: 0dblTapNum: 0mltTapNum: 0lastMltTapped: 0pressNum: 0swipeLeftNum: 0swipeRightNum: 0swipeUpNum: 0swipeDownNum: 0}computed:{returnx: thisxy: thisymethods: true}methods:{thisprop = !thisprop}{thistapNum++}{thisdblTapNum++}{thismltTapNum++thislastMltTapped = tapped}{thispressNum++}{thisswipeLeftNum++}{thisswipeRightNum++}{thisswipeUpNum++}{thisswipeDownNum++}{console}{console}{console}
Document
[WIP]