实用ES6代码片段
将字符串复制到剪贴板 const copyToClipboard = str => { const el = document.createElement(‘textarea’); el.value = str; el.setAttribute(‘readonly’, ”); el.style.position = ‘absolute’; el.style.left = ‘-100%’; document.body.appendChild(el); co …
将字符串复制到剪贴板 const copyToClipboard = str => { const el = document.createElement(‘textarea’); el.value = str; el.setAttribute(‘readonly’, ”); el.style.position = ‘absolute’; el.style.left = ‘-100%’; document.body.appendChild(el); co …