copy(){
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value'," 你想要复制的内容 ")
input.select()
if (document.execCommand('copy')) {
document.execCommand('copy')
}
document.body.removeChild(input)
}
转载于:https://www.cnblogs.com/z-y-zone/p/11477140.html