Vue.js Clipboard Plugin
npm install v-clipboard

https://codesandbox.io/s/epic-waterfall-17yet5?file=/src/App.vue
``bash`
npm install --save v-clipboard
`bash`
yarn add v-clipboard
`javascript
import Vue from 'vue'
import Clipboard from 'v-clipboard'
Vue.use(Clipboard)
`
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`
`vue`
Copying dynamic value (directive should recieve a function that returns value):
`vue`
Copying anything in your methods:
`js`
this.$clipboard(value)
Without plugin:
`js
import { Clipboard } from "v-clipboard"
Clipboard.copy(value)
`
`vue`
v-clipboard:success="clipboardSuccessHandler"
v-clipboard:error="clipboardErrorHandler">
Copy to clipboard
`js
{
methods: {
clipboardSuccessHandler ({ value, event }) {
console.log('success', value)
},
clipboardErrorHandler ({ value, event }) {
console.log('error', value)
}
}
}
``
