收藏
回答

Cannot read property 'getContext' of undefined?

在canvas设置了type="2d"是可以正常生成海报,但在调用wx.canvasToTempFilePath,错误信息:canvasToTempFilePath: fail canvas is empty

通过资料查询是在调用wx.canvasToTempFilePath时,canvas不用设置了type="2d",于是我将type="2d"去除,在生产海报,出现错误信息:Cannot read property 'getContext' of undefined,

代码判断:https://developers.weixin.qq.com/s/MfQEGemg73qd

回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2021-05-12

    2021-05-12
    有用
    回复 4
    • 木木夕
      木木夕
      2021-05-12
      在canvas设置了type='2d'但在wx.canvasToTempFilePath时,errMsg: "canvasToTempFilePath: fail canvas is empty"}
      2021-05-12
      回复
    • Mr.Zhao
      Mr.Zhao
      2021-05-12回复木木夕
      好好看看,别心急,文档都不看
      2021-05-12
      回复
    • 木木夕
      木木夕
      2021-05-12
      已经解决问题了,感谢回答!
      2021-05-12
      回复
    • 一拳打爆科院
      一拳打爆科院
      2023-11-26回复木木夕
      你好,请问是怎么解决的www
      2023-11-26
      回复
登录 后发表内容