问题描述:
自定义组件内实现canvas保存图片,canvas绘图正常,获取临时路径时客户端直接闪退
//获取临时路径
getTempFilePath: function (canvasId) {
let tempUrl = '';
var _this = this;
wx.canvasToTempFilePath({
canvasId: canvasId,
success: (res) => {
tempUrl = res.tempFilePath;
},
fail: (error) => {
console.log(error)
}
},this)
https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasToTempFilePath.html自定义组件的this传了么
都传了,如果canvas隐藏是无法生成图片的是嘛?