關注公眾號【Miles】查看更多技術文檔
<el-button
type="text"
v-clipboard:copy="copyContent"
v-clipboard:success="handleCopy"
v-clipboard:error="handleError"
>點擊復制</el-button>
let copyContent = "我是被復制的內容";
handleCopy() {
this.$messagesouth({
message: "復制成功",
type: "comm",
center: true
});
}
handleError() {
this.$messagesouth({
message: "復制失敗",
type: "comm",
center: true
});
}
效果如下圖所示:
image.png