mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
fix: 解决导出图片白边的问题
This commit is contained in:
parent
b3422eaede
commit
ce34a7ed2a
@ -178,7 +178,9 @@ export const canvasCut = (html: HTMLElement | null, callback?: Function) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
html2canvas(html).then((canvas: HTMLCanvasElement) => {
|
html2canvas(html, {
|
||||||
|
backgroundColor: null
|
||||||
|
}).then((canvas: HTMLCanvasElement) => {
|
||||||
window['$message'].success('导出成功!')
|
window['$message'].success('导出成功!')
|
||||||
downloadByA(canvas.toDataURL(), undefined, 'png')
|
downloadByA(canvas.toDataURL(), undefined, 'png')
|
||||||
if (callback) callback()
|
if (callback) callback()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user