This commit is contained in:
xiaozhiyong
2023-04-28 13:17:30 +08:00
parent 065a1729b1
commit 3b2691214e

View File

@@ -1,15 +1,15 @@
import Vue from "vue";
import Clipboard from "clipboard";
import Vue from 'vue'
import Clipboard from 'clipboard'
export default function (event) {
const clipboard = new Clipboard(event.target);
clipboard.on("success", () => {
Vue.prototype.$message.success("复制成功");
clipboard.destroy();
});
clipboard.on("error", () => {
Vue.prototype.$message.error("复制失败");
clipboard.destroy();
});
clipboard.onClick(event);
const clipboard = new Clipboard(event.target)
clipboard.on('success', () => {
Vue.prototype.$message.success('复制成功')
clipboard.destroy()
})
clipboard.on('error', () => {
Vue.prototype.$message.error('复制失败')
clipboard.destroy()
})
clipboard.onClick(event)
}