From ce34a7ed2ac3388e433ce1a45cf911762dcb662a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=94=E8=B7=91=E7=9A=84=E9=9D=A2=E6=9D=A1?= <1262327911@qq.com> Date: Thu, 9 Jun 2022 08:59:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=99=BD=E8=BE=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index e8db216c..51042dcc 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -178,7 +178,9 @@ export const canvasCut = (html: HTMLElement | null, callback?: Function) => { return } - html2canvas(html).then((canvas: HTMLCanvasElement) => { + html2canvas(html, { + backgroundColor: null + }).then((canvas: HTMLCanvasElement) => { window['$message'].success('导出成功!') downloadByA(canvas.toDataURL(), undefined, 'png') if (callback) callback()