Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-touch

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-touch - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

bower.json

8

component.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc