
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
vue2-hammer
Advanced tools
Hammer.js wrapper for Vue 2.x to support some touching operation in the mobile.
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.
If you want to find a same wrapper for Angular4+, you can have a look at ngx-hammer
This plugin supports Vue >= 2.0.
Available through npm as vue2-hammer
.
npm install vue2-hammer
import { VueHammer } from 'vue2-hammer'
Vue.use(VueHammer)
v-hammer
directive<a v-hammer:tap="onTap">Tap me!</a>
<div v-hammer:swipe.left="onSwipeLeft">Swipe me!</div>
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:tap="onTap"
v-hammer:pan:horizontal="onPanHorizontal"
v-hammer:panstart="onPanStart"
v-hammer:panend="onPanEnd"
v-hammer:press="onPress"
v-hammer:pressup="onPressup"
></a>
<a ></a>
<a ></a>
See Hammer.js documentation for all available events.
tap, pan, pinch, press, rotate, swipe
up, down, left, right, horizontal, vertical, all
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.
yarn
or npm i
yarn build
or npm run build
FAQs
Hammer.js wrapper for Vue 2.x to support some touching operation in the mobile.
The npm package vue2-hammer receives a total of 3,820 weekly downloads. As such, vue2-hammer popularity was classified as popular.
We found that vue2-hammer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.