Long Press Plugin For Vue.js

Long Press Plugin For Vue.js

A Vue.js directive that detects the long press event on your webpage.


Long press directive plugin for Vue.js. See the live demo.

npm install vue-long-press-directive


Register the plugin with Vue. It's possible to specify the press duration in the options object.

var Vue = require('vue')
var longpress = require('vue-long-press-directive')

Vue.use(longpress, { duration: 1000 })

The directive can now be used in a template.

<button v-long-press='onlongpress'>Press and hold</button>

Github Repository

Tags: #VueJs