点击复制,兼容ios-safari
let oInput = document.createElement("input");
oInput.value = "recheyouping";
oInput.readOnly="readOnly";
document.body.appendChild(oInput);
oInput.select(); // 选择对象
oInput.setSelectionRange(0, 20); //兼容ios-safari核心代码
document.execCommand("Copy"); // 执行浏览器复制命令
oInput.className = "oInput";
oInput.style.display = "none";
this.$message.show({
msg: "复制成功!"
});
复制代码