# vue-directive-long-press

> Vue directive for Long Press

Latest version **1.1.0** (published 2019-01-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install vue-directive-long-press
pnpm add vue-directive-long-press
yarn add vue-directive-long-press
bun add vue-directive-long-press
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-01-08 |
| First published | 2018-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | FeliciousX |
| Maintainers | feliciousx |
| Keywords | vue, directive, long-press |

## Links

- npm: https://www.npmjs.com/package/vue-directive-long-press
- Repository: https://github.com/FeliciousX/vue-directive-long-press
- Homepage: https://github.com/FeliciousX/vue-directive-long-press#readme
- Issues: https://github.com/FeliciousX/vue-directive-long-press/issues
- npm.io page: https://npm.io/package/vue-directive-long-press

## Recent versions

- 1.1.0 (latest) — 2019-01-08
- 1.0.0 — 2019-01-04
- 0.3.0 — 2018-12-14
- 0.2.3 — 2018-05-04
- 0.2.2 — 2018-04-22
- 0.2.1 — 2018-04-22
- 0.2.0 — 2018-04-22
- 0.1.0 — 2018-04-22

## README

# Long Press - Vue directive
[![Build Status](https://travis-ci.org/FeliciousX/vue-directive-long-press.svg?branch=master)](https://travis-ci.org/FeliciousX/vue-directive-long-press)

expose long press event on any element or component

## Getting Started

```bash
npm install vue-directive-long-press
```

```vue
<template>
  <button
    v-long-press="300"
    @long-press-start="onLongPressStart"
    @long-press-stop="onLongPressStop">
    Click and Hold for 300ms</button>
</template>
<script>
import LongPress from 'vue-directive-long-press'

export default {
  directives: {
    'long-press': LongPress
  },
  methods: {
    onLongPressStart () {
      // triggers after 300ms of mousedown
    },
    onLongPressStop () {
     // triggers on mouseup of document
    }
  }
}
</script>
```

To use directive globally

```typescript
import Vue from 'vue'
import LongPress from 'vue-directive-long-press'

Vue.directive('long-press', LongPress)
```

## Demo
View and edit the demo at StackBlitz [here](https://stackblitz.com/edit/vue-directive-long-press-demo)!

## Running the tests

```
npm run test
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

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