原生js实现复制操作
export const cop = (text) => {
if(navigator.clipboard!==‘undefined’) {
navigator.clipboard.writeText(text)
}else {
let oInput = document.createElement('input')
oInput.value = text
document.body.appendChild(oInput)
oInput.select()
document.execCommand('copy')
oInput.style.display = 'none'
document.body.removeChild(oInput)
}
}