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) }
z-y-zone 2019-09-06 17:39 原文
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) }