Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vue-tap-and-hold

ciming36MIT1.0.7

This is a lightweight vue plugin for Tap Event and Long Press Event in mobile

vue, vue2, tap, long press, long click

readme

vue-tap-and-hold

This is a lightweight vue2 plugin for Tap Event and Long Press Event in mobile

How To use

npm i vue-tap-and-hold --save
import TapAndHold form 'vue-tap-and-hold'
Vue.use(vueTap, {
    holdTime: 2000 // default is 1000
    tapTime: 200 // default is 200
})

You can also directly include it with a <script> tag

template

<!-- tap -->
<p v-tap="handle"></p> 

<!-- long press -->
<p v-hold="handle"></p> 

<!-- preventDefault -->
<p v-hold.prevent="handle"></p> 

<!-- stopPropagation -->
<p v-hold.stop="handle"></p> 

<!-- with params -->
<p v-tap="handle.bind(null, params)"></p>