fix: 修复导出图片会丢失头像的问题 (#392)

This commit is contained in:
CornerSkyless 2023-03-09 17:59:26 +08:00 committed by GitHub
parent 07cac12dac
commit 5b74ac9cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -284,7 +284,9 @@ function handleExport() {
try {
d.loading = true
const ele = document.getElementById('image-wrapper')
const canvas = await html2canvas(ele as HTMLDivElement)
const canvas = await html2canvas(ele as HTMLDivElement, {
useCORS: true,
})
const imgUrl = canvas.toDataURL('image/png')
const tempLink = document.createElement('a')
tempLink.style.display = 'none'