--fix bug

This commit is contained in:
yuping
2023-03-23 14:33:59 +08:00
parent 0617c24749
commit f3af185d0a

View File

@@ -86,12 +86,10 @@ function download() {
document.querySelector(".downloadCode"),
{ useCORS: true }
).then((canvas) => {
let filename = `${new Date().getTime()}.png`;
let imageUrl = canvas.toDataURL("image/png");
let a = document.createElement("a");
a.style.display = "none";
a.download = filename;
a.href = imageUrl;
a.download = `${new Date().getTime()}.png`;
a.href = canvas.toDataURL("image/png");
document.body.appendChild(a);
a.click();
});