<template>
<div>
<p>{{ content }}</p>
<el-button
v-clipboard:copy="content"
v-clipboard:success="copySuccess"
v-clipboard:error="copyFailed"
>复制</el-button>
</div>
</template>
<script>
export default {
data() {
return {
content: '南无啊弥陀佛'
}
},
methods: {
copySuccess: function () {
this.$alert("复制成功");
},
copyFailed: function () {
this.$alert("复制失败");
}
}
}
</script>
09-09
1429
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-13