瀏覽代碼

fix: 尝试处理背景图片无法截图的问题

奔跑的面条 3 年之前
父節點
當前提交
520f46adc3
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/utils/utils.ts

+ 3 - 1
src/utils/utils.ts

@@ -177,7 +177,9 @@ export const canvasCut = (html: HTMLElement | null, callback?: Function) => {
   }
 
   html2canvas(html, {
-    backgroundColor: null
+    backgroundColor: null,
+    allowTaint: true,
+    useCORS: true
   }).then((canvas: HTMLCanvasElement) => {
     window['$message'].success('导出成功!')
     downloadByA(canvas.toDataURL(), undefined, 'png')