其實(shí)就是把值賦給一個(gè)創(chuàng)建的節(jié)點(diǎn)選中
copyUrl('string')
copyUrl(url) {
var domUrl = document.createElement("input");
domUrl.value = url;
domUrl.id = "creatDom";
document.body.appendChild(domUrl);
domUrl.select(); // 選擇對(duì)象
document.execCommand("Copy"); // 執(zhí)行瀏覽器復(fù)制命令
let creatDom = document.getElementById("creatDom");
creatDom.parentNode.removeChild(creatDom);
alert("已復(fù)制好甚疟,可貼粘溃睹。");
}