From fd3711eea47bdba7cb023ccaf8502347610285f1 Mon Sep 17 00:00:00 2001 From: Jerry Bendy Date: Tue, 17 Dec 2019 17:28:17 +0800 Subject: [PATCH] Update documents and change version to v2.1.0 --- README.md | 45 +++++++++++++++++++++++++++++++++++---------- package.json | 2 +- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 93fb8f8..d15c506 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ # vue-touch-events [![](https://img.shields.io/npm/v/vue2-touch-events.svg)](https://www.npmjs.com/package/vue2-touch-events) -Enable tap / swipe events for VueJS 2.x +Enable tap / swipe / touch hold events for vue.js 2.x -> Note: This is for **Vue 2.x** only. +> Note: This is for **vue.js 2.x** only. -Supports: +Features: -* `tap` for tap the screen or click the mouse -* `longtap` for long tap -* `swipe` for swipe your finger or mouse in a direction (left/top/right/bottom) -* `start` for start tap or mouse down -* `end` for tap end or mouse up -* `moving` for moving finger or mouse +* Common touch events, such as `tap`, `swipe`, `touchhold` ([more](#Bindings)) +* All events support mouse and touch screen at same time +* Optimized touch effects with `touchClass` option and `v-touch-class` directive +* Binding multiple touch events on one DOM element +* Customizable events with native-likely events handler ## Install @@ -59,6 +58,8 @@ In your `.vue` file: Triggered once when starting to move and tapTolerance is exceeded Continuously triggering Event + +Touch and hold on the screen for a while `longtap` will be deprecated in next major version. Please use `touchhold` insead. If you still want to use this feature, please let me know. + +`longtap` means touch on the screen and hold for a while. It will be triggered when you release your finger. (It's not normal when we use touch devices, so it's a good choice to use `touchhold` instaed) + +#### v-touch:touchhold `(v2.1.0)` +`touchhold` will be triggered when touch on the screen and hold for `touchHoldTolerance` milliseconds. This will be triggered before your finger released, as what native APP does. + +#### v-touch:start / v-touch:end / v-touch:moving +* `start` is same as `touchstart` or `mousedown`. +* `end` is same as `touchend` or `mouseup`. +* `moving` is same as `touchmovoe` or `mousemove`. + +These three events are like native DOM events. You can use these events to custom behaviors which this library doesn't support yet. + ### Modifiers #### left, right, top, bottom diff --git a/package.json b/package.json index b7efdc8..7abbcc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue2-touch-events", - "version": "2.0.1", + "version": "2.1.0", "description": "Simple touch events support for vueJS2", "main": "index.js", "types": "index.d.ts",