Skip to content

Commit

Permalink
fix: 修复导出图片会丢失头像的问题 (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
CornerSkyless authored Mar 9, 2023
1 parent 7168526 commit a2b0765
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 a2b0765

Please sign in to comment.