methods: {
Copy(copyInfo) {
return new Promise((resolve, reject) => {
let copyUrl = document.createElement("input"); //创建一个input框获取需要复制的文本内容
copyUrl.value = copyInfo;
let appDiv = document.getElementById('app');
appDiv.appendChild(copyUrl);
copyUrl.select();
document.execCommand("Copy");
copyUrl.remove()
resolve(true);
})
}
}
网友评论