[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啊?
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啊?
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自: