vueclaw

A wrapper for Claw.


Keywords
claw, directive, event, gesture, mouse, pan, pinch, plugin, press, rotate, swipe, tap, touch, vue
License
MIT
Install
npm install vueclaw@1.1.0

Documentation

VueClaw

A wrapper for Claw.

demo

Try it out!

dependencies

setup

npm

npm install vueclaw

ES module

Register the directive globally.

import Vue from 'vue';
import VueClaw from 'vueclaw';

Vue.directive(VueClaw.name, VueClaw);

or

Register the directive in the scope of a component.

import VueClaw from 'vueclaw';

export default {
  directives: {
    [VueClaw.name]: VueClaw,
  },
  /*...*/
};

browser

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/@seregpie/claw"></script>
<script src="https://unpkg.com/vueclaw"></script>

If Vue is detected, the directive will be registered automatically.

usage

<template>
  <div
    v-claw:pan="onPan"
    v-claw:tap="onTap"
  ><!--...--></div>
</template>
<script>
export default {
  methods: {
    onPan(event) {
      // handle pan
    },
    onTap(event) {
      // handle tap
    },
  },
  /*...*/
};
</script>