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

vue-recognizer

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-recognizer

Vue.js plugin to recognize touch, mouse, pointer events using hammerjs

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
decreased by-68.6%
Maintainers
1
Weekly downloads
 
Created
Source

vue-recognizer Build Status

Vue.js plugin to recognize touch, mouse, pointer events using Hammer.js.

Install

npm install --save vue-recognizer

Usage

Import vue-recognizer and install it.

import Vue from 'vue';
import VueRecognizer from 'vue-recognizer';

Vue.use(VueRecognizer);
<template>
  <div
    v-recognizer:pan="onPan"
    v-recognizer:pan.right="onPanRight"
  >
    Lorem ipsum
  </div>
</template>

<script lang="ts">
import Vue from 'vue';

export default Vue.extend({
  methods: {
    onPan(e: HammerInput) {...},
    onPanRight(e: HammerInput) {...}
  }
});
</script>

As Nuxt plugin

Prepare plugin file to install this plugin as below. Then name it such as vue-recognizer.ts and put it into plugins folder.

import Vue from 'vue';
import VueRecognizer from 'vue-recognizer';

Vue.use(VueRecognizer);

To load it, configure nuxt.config.js or nuxt.config.ts as below.

const config = {
  plugins: [
    {
      src: '~/plugins/vue-recognizer.ts',
      ssr: false
    }
  ]
};

export default config;

API

Pan

  • v-recognizer:pan="onPan"
  • v-recognizer:pan.start="onPanStart"
  • v-recognizer:pan.move="onPanMove"
  • v-recognizer:pan.end="onPanEnd"
  • v-recognizer:pan.cancel="onPanCancel"
  • v-recognizer:pan.left="onPanLeft"
  • v-recognizer:pan.right="onPanRight"
  • v-recognizer:pan.up="onPanUp"
  • v-recognizer:pan.down="onPanDown"

Pinch

  • v-recognizer:pinch="onPinch"
  • v-recognizer:pinch.start="onPinchStart"
  • v-recognizer:pinch.move="onPinchMove"
  • v-recognizer:pinch.end="onPinchEnd"
  • v-recognizer:pinch.cancel="onPinchCancel"
  • v-recognizer:pinch.in="onPinchIn"
  • v-recognizer:pinch.out="onPinchOut"

Press

  • v-recognizer:press="onPress"
  • v-recognizer:press.up="onPressUp"

Rotate

  • v-recognizer:rotate="onRotate"
  • v-recognizer:rotate.start="onRotateStart"
  • v-recognizer:rotate.move="onRotateMove"
  • v-recognizer:rotate.end="onRotateEnd"
  • v-recognizer:rotate.cancel="onRotateCancel"

Swipe

  • v-recognizer:swipe="onSwipe"
  • v-recognizer:swipe.left="onSwipeLeft"
  • v-recognizer:swipe.right="onSwipeRight"
  • v-recognizer:swipe.up="onSwipeUp"
  • v-recognizer:swipe.down="onSwipeDown"

Tap

  • v-recognizer:tap="onTap"
  • v-recognizer:doubletap="onDoubleTap"

License

MIT © Shogo Sensui

Keywords

FAQs

Package last updated on 14 Mar 2020

Did you know?

Socket

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.

Install

Related posts

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