forked from github/dataease
fix: imgUtils中downloadCanvas报错
This commit is contained in:
parent
af1786d05b
commit
3884557dce
@ -88,6 +88,7 @@ export function downloadCanvas2(type, canvasDom, name, callBack?) {
|
|||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
a.setAttribute('download', name)
|
a.setAttribute('download', name)
|
||||||
a.href = dataUrl
|
a.href = dataUrl
|
||||||
|
document.body.appendChild(a)
|
||||||
a.click()
|
a.click()
|
||||||
document.body.removeChild(a)
|
document.body.removeChild(a)
|
||||||
} else {
|
} else {
|
||||||
@ -123,6 +124,7 @@ export function downloadCanvas(type, canvasDom, name, callBack?) {
|
|||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
a.setAttribute('download', name)
|
a.setAttribute('download', name)
|
||||||
a.href = dataUrl
|
a.href = dataUrl
|
||||||
|
document.body.appendChild(a)
|
||||||
a.click()
|
a.click()
|
||||||
document.body.removeChild(a)
|
document.body.removeChild(a)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user