Install & Download:
# Yarn
$ yarn add vue-long-click
# NPM
$ npm install vue-long-click --saveDescription:
A Vue.js directive used to trigger certain events on long click.
How to use it:
1. Import and register the directive.
import { longClickDirective } from 'vue-long-click'const longClickInstance = longClickDirective({
delay: 500, // default: 400
interval: 60, // default: 50
})
Vue.directive('longclick', longClickInstance)2. Basic usage.
<button v-longclick="() => CustomFunction()">+</button>
Preview:

Changelog:
v0.1.0 (09/04/2021)
- fix: pass raw events to handler