copy(data) {
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', data)
input.select()
if (document.execCommand('copy')) {
document.execCommand('copy')
this.$message({
showClose: true,
message: '复制成功',
type: 'success'
})
}
document.body.removeChild(input)
}
简单点击复制内容
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
MySQL 组复制搭建
MySQL 组复制搭建
MySQL -
点击复制js
<html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .text-i
javascript 开发语言 ecmascript Text 隐藏域 -
js点击复制
window.clipboardData.setData("Text", text) document.execCommand("copy");
typescript javascript 前端 github Text