private copyInClipper(txt) { let copy = document.createElement("input"); copy.value = txt; document.body.appendChild(copy); copy.select(); copy.setSelectionRange(0, copy.value.length), document.execCommand('Copy'); document.body.removeChild(copy); }
然后粘贴
还有其他js方法.https://www.cnblogs.com/tylerdonet/p/4533782.html