Skip to content

Commit

Permalink
fix: 修复导出图片会丢失头像的问题 (Chanzhaoyu#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
CornerSkyless committed Mar 9, 2023
1 parent 07cac12 commit 5b74ac9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/views/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 5b74ac9

Please sign in to comment.