vue2-clipboards
v0.0.6
Published
Vue2.0 directive to copy or cut text to clipboard.
Downloads
31
Readme
vue-clipboard
Vue2.0 directive to copy or cut text to clipboard.
Vue wrapper for clipboard.
Install
$ npm install vue2-clipboards
Usage
const VueClipboards = require('vue2-clipboards');
Vue.use(VueClipboards);
new Vue({
data() {
return {
copyData: 'copy data'
}
}
});
<button v-clipboard="copyData">Copy</button>
Event
<button v-clipboard="copyData" @success="handleSuccess" @error="handleError">Copy</button>
const VueClipboards = require('vue2-clipboards');
Vue.use(VueClipboards);
new Vue({
data() {
return {
copyData: 'copy data'
}
},
methods: {
handleSuccess(e) {
console.log(e);
},
handleError(e) {
console.log(e);
},
}
});