vcopy
v0.0.1
Published
A simple vue plugin use for copy
Downloads
2
Readme
Vcopy
A simple vue plugin use for copy.
npm i vcopy --save
import Vue from 'vue'
import vcopy from 'vcopy'
Vue.use(vcopy, {
// directive name
name: 'copy',
// success tip
success: function () {
alert('copy success')
},
// failure tip
failure: function () {
alert('copy failure')
},
// format copy content
formater: function (v) {
return String(v)
}
})
<template>
<div id="app">
<textarea v-model="msg"></textarea>
<button v-copy="msg">COPY</button>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
msg: 'Welcome to Your'
}
}
}
</script>