自定义组件canvas2d 怎么调用canvasToTempFilePath呢?传入了canvas实
传入了canvas实例也不行,报错为this.canvasToTempFilePath is not a function
export() {
this.canvasToTempFilePath({
canvas:canvas,
destWidth: this.data.width * (wx.getSystemInfoSync().pixelRatio / 2),
destHeight: this.data.height * (wx.getSystemInfoSync().pixelRatio / 2),
success: (res) => {
resolve(res.tempFilePath);
},
fail: (e) => {
reject(e);
},
});