[LayaAirIDE 2.0]wx.canvasToTempFilePath在TS下如何使用啊?

wx.canvasToTempFilePath({
x: 0,
y: 0,
width: 100,
height: 100,
destWidth: 100,
destHeight: 100,
canvasId: 'myCanvas',
success: function (res) {
wxd.shareUrl = res.tempFilePath
wxd.ShareAppMessage()
console.log(res.tempFilePath)
}
})

一直报错[ts] The 'this' context of type 'typeof wx' is not assignable to method's 'this' of type 'string'.

canvasId也是我乱写的 如果才能正确获取小游戏当前画布的canvasId啊?
已邀请:

Aar0n

赞同来自:

把demo上传吧

要回复问题请先

商务合作
商务合作