vue-hammer
Hammer.js wrapper for Vue to support some operation in the mobile
This is a directive wrapper for Hammer.js 2.x. And this repo'inspiration is from v-touch.
Install
This plugin supports Vue >= 2.0.
npm
Available through npm as vue2-hammer.
npm install vue2-hammerimport { VueHammer } from 'vue2-hammer'
Vue.use(VueHammer)Usage
Using the v-hammer directive
<a v-hammer:tap="onTap">Tap me!</a>
<div v-hammer:swipe.left="onSwipeLeft">Swipe me!</div>Configuring Recognizer Options
There are two ways to customize recognizer options such as direction and threshold. The first one is setting global options:
// change the threshold for all swipe recognizers
VueHammer.config.swipe = {
threshold: 200
}<a v-hammer:doubletap="onDoubleTap"></a>See Hammer.js documentation for all available events.
Supported gestures and directions
gestures
tap, pan, pinch, press, rotate, swipe, doubletap
directions
up, down, left, right, horizontal, vertical, all
Note
Users can use both the gesture and the direction like v-hammer:swipe.left. But if your combination is not exist in the hammer, it is not support.
Run the Example
- Run
yarnornpm i - Run
yarn buildornpm run build - Open the index.html in the example directory.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
