Comparing version 0.0.2 to 0.1.0
{ | ||
"name": "vue-touch", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"scripts": ["index.js"], | ||
"version": "0.1.0", | ||
"main": "vue-touch.js", | ||
"description": "Hammer.js based touch events plugin for Vue.js", | ||
"license": "MIT", | ||
"scripts": ["vue-touch.js"], | ||
"dependencies": { | ||
@@ -7,0 +9,0 @@ "hammerjs/hammer.js": "^2.0.1" |
{ | ||
"name": "vue-touch", | ||
"version": "0.0.2", | ||
"main": "index.js", | ||
"version": "0.1.0", | ||
"main": "vue-touch.js", | ||
"description": "Hammer.js based touch events plugin for Vue.js", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -17,4 +19,5 @@ "type": "git", | ||
"scripts": { | ||
"build": "browserify -e example/example.js -o example/example.build.js" | ||
"build": "browserify -e example/example.js -o example/example.build.js", | ||
"dev": "watchify -e example/example.js -o example/example.build.js" | ||
} | ||
} |
@@ -9,9 +9,19 @@ # vue-touch | ||
Currently only available via Component or Browserify. For other use cases just take a look at the source. It's really simple. | ||
### CommonJS | ||
``` js | ||
var vueTouch = require('vue-touch') | ||
Vue.use(vueTouch) | ||
``` | ||
- Available through npm as `vue-touch`. For Duo/Component you can isntall as `vuejs/vue-touch`. | ||
``` js | ||
var vueTouch = require('vue-touch') | ||
Vue.use(vueTouch) | ||
``` | ||
### Direct include | ||
- You can also directly include it with a `<script>` tag when you have Vue itself included globally. It will automatically install itself, and will add a global `VueTouch`. | ||
### Use in templates | ||
Then you can do this: | ||
``` html | ||
@@ -21,5 +31,17 @@ <a v-touch="tap:onTap">Tap me!</a> | ||
### Register a custom event | ||
``` js | ||
// example registering a custom doubletap event. | ||
// the `type` indicates the base recognizer to use from Hammer | ||
// all other options are Hammer recognizer options. | ||
VueTouch.registerCustomEvent('doubletap', { | ||
type: 'tap', | ||
taps: 2 | ||
}) | ||
``` | ||
See [Hammer.js documentation](http://hammerjs.github.io/getting-started.html) for all available events. | ||
See `/example` for listening to multiple events together and how to register a custom event like `'doubletap'`. To build the example, you need to have Browserify installed and then `npm run build`. | ||
See `/example` for a multi-event demo. To build the example, you need to have Browserify installed and then `npm run build`. | ||
@@ -26,0 +48,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
6003
8
0
140
48
1