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
3c820d53a6
commit
1252d266dd
@ -155,7 +155,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()
|
||||
|
@ -133,7 +133,9 @@ export const useSync = () => {
|
||||
const range = document.querySelector('.go-edit-range') as HTMLElement
|
||||
const ruler = document.getElementById('mb-ruler')
|
||||
// 生成图片
|
||||
const canvasImage: HTMLCanvasElement = await html2canvas(range)
|
||||
const canvasImage: HTMLCanvasElement = await html2canvas(range, {
|
||||
backgroundColor: null
|
||||
})
|
||||
|
||||
// 上传预览图
|
||||
let uploadParams = new FormData()
|
||||
|
Loading…
x
Reference in New Issue
Block a user