使用html2canvas时遇到?DOMException:无法在“ ShadowRoot”上设置“ adoptedStyleSheets”属性:不允许在多个文档中共享构造的样式表
html2canvas(document.getElementById('qr-code-content'), {useCORS: true}).then(canvas => {
document.getElementById('qr-code-content').append(canvas);
this.base64ImgData = canvas.toDataURL();
this.sharing = true;
});
Run Code Online (Sandbox Code Playgroud)
此 PR 解决了这个问题。https://github.com/niklasvh/html2canvas/pull/2020
如果您需要快速解决方案,您可以使用分叉,或者等到它合并并从主存储库获取它。
| 归档时间: |
|
| 查看次数: |
297 次 |
| 最近记录: |