<div>{{copys}}</div>
<div v-clipboard:copy="copys" v-clipboard:success="copy">复制</div>
data(){
return{
copys:'内容'
}
},
methods:{
copy(){
console.log('成功复制到粘贴板!')
}
}
<div>{{copys}}</div>
<div v-clipboard:copy="copys" v-clipboard:success="copy">复制</div>
data(){
return{
copys:'内容'
}
},
methods:{
copy(){
console.log('成功复制到粘贴板!')
}
}
本文标题:vue 实现点击复制
本文链接:https://www.haomeiwen.com/subject/nzpdjftx.html
网友评论