Detect Long Press In Vue App

A small yet sometimes useful Vue.js directive to detect and handle the long press event on an element.

How to use it:

Import the LongPress.

import LongPress from 'vue-directive-long-press'

Use the directive.

    Click and Hold for 500ms</button>
export default {
  directives: {
    'long-press': LongPress
  methods: {
    onLongPressStart () {
      // do something
    onLongPressStop () {
      // do something


Detect Long Press In Vue App

Download Details:

Author: FeliciousX

Live Demo:

Download Link:

Official Website:

Install & Download:

$ npm install vue-directive-long-press --save

Add Comment