Touch Events in Vue 2.0

戏子无情 提交于 2019-12-03 22:38:36

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!