【工具箱】复制进剪切板

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

猜你喜欢

转载自www.cnblogs.com/harrickheng/p/11284701.html
今日推荐