copy(val) {
let oInput = window.document.createElement('input')
oInput.value = val
window.document.body.appendChild(oInput)
oInput.select() // 选择对象;
window.document.execCommand('Copy') // 执行浏览器复制命令
window.alert('复制成功')
oInput.remove()
},
More other copying solutions: How to copy text through js js to operate the clipboard