Skip to content

Commit

Permalink
fix(avatarcrppoer): undefined (#3167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang authored Aug 12, 2024
1 parent a4e64ee commit 8db232f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/packages/__VUE/avatarcropper/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ export default create({
// base64转图片(canvasImage)
const dataURLToCanvasImage = (canvas: any, dataURL: string): Promise<HTMLImageElement> => {
if (!canvas) {
return Promise.reject(new Error('Invalid canvas element'))
}
return new Promise((resolve) => {
const img = canvas.createImage()
img.onload = () => resolve(img)
Expand Down

0 comments on commit 8db232f

Please sign in to comment.