Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Touch Events in Vue 2.0 [closed]

Tags:

I'm using Vue 2.0 and I should work with swipe gestures. I have checked that there is one official plugin (named vue-touch) but as they say, Vue 2.0 is not supported yet.

Which libraries are available for Vue 2.0 to implement touch events?

like image 321
Asqan Avatar asked Mar 09 '17 11:03

Asqan


2 Answers

I checked and there already is a vue-touch for Vue 2.0, it is on another branch though:

This branch is only compatible with Vue 1.0. For the Vue 2.0 compatible rewrite, see the next branch

https://github.com/vuejs/vue-touch/tree/next

like image 181
Stephan-v Avatar answered Sep 22 '22 21:09

Stephan-v


You can easily use Hammer directly in Vue. Create Vue directives to wrap the Hammer touch events you're interested in. Do this once for your whole app. This is easy and shouldn't put you off.

Vue2-hammer (1600 weekly npm downloads) also wraps hammer but for the moment I'm choosing to do this directly. Vue2-touch-events (5000 weekly npm downloads) does not leverage Hammer, which seems brave.

like image 45
bbsimonbb Avatar answered Sep 21 '22 21:09

bbsimonbb