document.execCommand('copy')踩的坑
let input = document.createElement('input');
document.body.appendChild(input);
input.setAttribute('value', JSON.stringify(this.cachePrintList));
input.select();
let result = document.execCommand('copy');
复制元素内容代码,此方法在axios或者异步中无法使用,复制会失败,浏览器出于安全考虑,只能在用户操作中,同步才能复制

浙公网安备 33010602011771号