真机 ctx.draw()不执行。在微信开发者工具上是可以的,真机不行
代码:
subCanvas() {this.ctx.draw(true, () => {uni.canvasToTempFilePath({canvasId: 'handWriting',fileType: 'png',quality: 1, //图片质量success: function(res) {var pages = getCurrentPages();var prevPage = pages[pages.length - 2]; //上一个页面var object={canvas:res.tempFilePath,}uni.navigateBack({delta: 1,success: function() {prevPage.$vm.otherFun(object);//重点$vm}})}});});},
解决方法:
ctx.draw(true,(()=>{//处理代码})())