Installations
npm install vue2-hammer
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.10.0
NPM Version
5.6.0
Score
76.6
Supply Chain
93.6
Quality
75.2
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (88.29%)
Vue (8.6%)
HTML (3.12%)
Developer
bsdfzzzy
Download Statistics
Total Downloads
1,904,920
Last Day
292
Last Week
3,729
Last Month
21,284
Last Year
286,161
GitHub Statistics
254 Stars
44 Commits
48 Forks
5 Watching
1 Branches
6 Contributors
Package Meta Information
Latest Version
2.1.2
Package Id
vue2-hammer@2.1.2
Size
38.96 kB
NPM Version
5.6.0
Node Version
8.10.0
Publised On
31 Oct 2018
Total Downloads
Cumulative downloads
Total Downloads
1,904,920
Last day
-72.7%
292
Compared to previous day
Last week
-26.9%
3,729
Compared to previous week
Last month
1.4%
21,284
Compared to previous month
Last year
-7.9%
286,161
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
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.
If you want to find a same wrapper for Angular4+, you can have a look at ngx-hammer
Install
This plugin supports Vue >= 2.0.
npm
Available through npm as vue2-hammer
.
1npm install vue2-hammer
1import { VueHammer } from 'vue2-hammer' 2Vue.use(VueHammer)
Usage
Using the v-hammer
directive
1<a v-hammer:tap="onTap">Tap me!</a> 2 3<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:
1// change the threshold for all swipe recognizers 2VueHammer.config.swipe = { 3 threshold: 200 4};
1<a 2 v-hammer:tap="onTap" 3 v-hammer:pan:horizontal="onPanHorizontal" 4 v-hammer:panstart="onPanStart" 5 v-hammer:panend="onPanEnd" 6 v-hammer:press="onPress" 7 v-hammer:pressup="onPressup" 8></a> 9<a ></a> 10<a ></a>
See Hammer.js documentation for all available events.
Supported gestures and directions
gestures
tap, pan, pinch, press, rotate, swipe
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
yarn
ornpm i
- Run
yarn build
ornpm run build
- Open the index.html in the example directory.
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 5/17 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Score
3.3
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More