Skip to content

Commit 1b070e7

Browse files
committed
【优化】canvas 下载图片
1 parent 520244e commit 1b070e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/views/ai/image/ImageTask.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const downloadImage = async (imageUrl) => {
7777
const canvas = document.createElement('canvas')
7878
canvas.width = image.width
7979
canvas.height = image.height
80-
const ctx = canvas.getContext('2d')
80+
const ctx = canvas.getContext('2d') as CanvasDrawImage
8181
ctx.drawImage(image, 0, 0, image.width, image.height)
8282
const url = canvas.toDataURL('image/png')
8383
const a = document.createElement('a')

0 commit comments

Comments
 (0)