# vue-touch-events

> extend touch event on vuejs

Latest version **1.0.3** (published 2017-04-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-touch-events
pnpm add vue-touch-events
yarn add vue-touch-events
bun add vue-touch-events
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-04-12 |
| First published | 2017-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | yuminjustin@163.com |
| Maintainers | yuminjustin |
| Keywords | vue, touch |

## Links

- npm: https://www.npmjs.com/package/vue-touch-events
- npm.io page: https://npm.io/package/vue-touch-events

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.2.6

## Recent versions

- 1.0.3 (latest) — 2017-04-12
- 1.0.2 — 2017-04-12
- 1.0.1 — 2017-04-11
- 1.0.0 — 2017-04-11

## README

# vue-touch-events
This is a plugin for Vuejs, it offer these events<br/>
**tap,longtap, swipeup,swipedown,swipeleft,swiperight,swipe,drag**

## Use
     import Touch from 'vue-touch-events'
     Vue.use(Touch)
	
In Vue component you can bind these touch event just like a normally click event

## template

    <div>
        <div class="block" v-touch.preventDefault @tap="tapCb" @longtap="longTapCb" @swipeup="swipeupCb" @swipedown="swipedownCb" @swipeleft="swipeleftCb" @swiperight="swiperightCb" @swipe="swipeCb">
            {{msg}}
        </div>
        <div class="block2" v-touch.preventDefault.drag @drag="dragCb">
            {{msg2}}
        </div>
    </div>

## script 

    new Vue({
	   el: "#app",
	   methods: {
		tapCb: ...,
		longTapCb: ...,
		swipeupCb: ...,
		swipedownCb: ...,
		swipeleftCb: ...,
		swiperightCb: ...,
		swipeCb: ...,
		dragCb: ...
	  }
    }) 

## config 

**preventDefault**<br/>

Prohibit browser swipe events, just like UC or QQBrowser them has own swipe events, so sometimes we have to prohibit.
Default is not prohibit<br/>

**drag**<br/>

This dom can be dragged ,default is can't. Drag event can't coexist with other touch events

<br/><br/>

## run this example
    npm install	

install webpack and Vue

    npm run dev

open index.html in your browser

## install in you project

    npm install vue-touch-events -S

## SSR 
   
    if (process.BROWSER_BUILD) {
      Vue.use(require('vue-touch-events'));
    }
   
use it only in browser

---
_Source: https://npm.io/package/vue-touch-events · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
