# @qualitech/v-clipboard

> Vue.js Clipboard Plugin

Latest version **2.3.0** (published 2022-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @qualitech/v-clipboard
pnpm add @qualitech/v-clipboard
yarn add @qualitech/v-clipboard
bun add @qualitech/v-clipboard
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2022-02-17 |
| First published | 2022-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | euvl |
| Maintainers | jarthursantos, aresende, christianvillar, andreluizgpereira, ecatule, lsshenrique, ercilio.dias |
| Keywords | vue, clipboard, vue clipboard, copy, vue copy |

## Links

- npm: https://www.npmjs.com/package/@qualitech/v-clipboard
- Repository: https://github.com/lsshenrique/v-clipboard
- Homepage: https://github.com/lsshenrique/v-clipboard#readme
- Issues: https://github.com/lsshenrique/v-clipboard/issues
- npm.io page: https://npm.io/package/@qualitech/v-clipboard

## Recent versions

- 2.3.0 (latest) — 2022-02-17

## README

[![npm version](https://badge.fury.io/js/v-clipboard.svg)](https://badge.fury.io/js/v-clipboard)

## Vue.js Clipboard

### Install

```bash
npm install --save v-clipboard
```

```javascript
import Vue from 'vue'
import Clipboard from 'v-clipboard'

Vue.use(Clipboard)
```

### Using

> When an element that contains `v-clipboard` directive is clicked, the value of `value` will be copied into clipboard.

Copying **static** value (directive should receive actual value):

```vue
<button v-clipboard="value">
  Copy to clipboard
</button>
```

Copying **dynamic** value (directive should recieve a function that returns value):

```vue
<button v-clipboard="() => value">
  Copy to clipboard
</button>
```

Copying **anything** in your methods:

```js
this.$clipboard(value)
```

### Events

```vue
<button v-clipboard="foo"
        v-clipboard:success="clipboardSuccessHandler" // Success event handler
        v-clipboard:error="clipboardErrorHandler">    // Error event handler
  Copy to clipboard
</button>
```

```js
{
  methods: {
    clipboardSuccessHandler ({ value, event }) {
      console.log('success', value)
    },

    clipboardErrorHandler ({ value, event }) {
      console.log('error', value)
    }
  }
}
```

### Compatibility

<p align="center">
  <img src="https://user-images.githubusercontent.com/1577802/28269902-8ae0e01e-6afb-11e7-9981-d4965bac69d1.png">
</p>

---
_Source: https://npm.io/package/@qualitech/v-clipboard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
