参考于 https://juejin.cn/post/6844903567480848391
利用命令 document.execCommand("copy");
需要创建一个可编辑区域,把他插入页面中,执行命令之后再移除
const input=document.createElement("input");
input.setAttribute("value",content);
document.body.appendChild(input);
input.select();
if(document.execCommand('copy')){
document.execCommand("copy");
this.tooltip_show[i].show=true;
this.tooltip_show[i].content="已复制";
}
document.body.removeChild(input);
导入包 clipboard.js