问题模块 | 框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|---|
API和组件 | 小程序 | Bug | canvas | 客户端 | 6.7.3 | 1.02.1809111 |
问题描述:
自定义组件内实现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)