[]async bug 导出小游戏
导出小游戏,
async/await 被转换, 微信开发者工具正常, 真机报错
ts代码
private async onShareClick() {
let share = SDKCenter.getShare();
share.title = ShareNormal;
share.imageUrl = ShareImgUrl;
let a = await share.shareAppMessage();
console.log(a)
}
转换后代码
onShareClick() {
// return __awaiter(this, void 0, void 0, function* () {
// let share = SDKCenter.getShare();
// share.title = ShareNormal;
// share.imageUrl = ShareImgUrl;
// let a = yield share.shareAppMessage();
// console.log(a);
// });
修改后正常代码
async onShareClick() {
let share = SDKCenter.getShare();
share.title = ShareNormal;
share.imageUrl = ShareImgUrl;
let a = await share.shareAppMessage();
console.log(a);
}
async/await 被转换, 微信开发者工具正常, 真机报错
ts代码
private async onShareClick() {
let share = SDKCenter.getShare();
share.title = ShareNormal;
share.imageUrl = ShareImgUrl;
let a = await share.shareAppMessage();
console.log(a)
}
转换后代码
onShareClick() {
// return __awaiter(this, void 0, void 0, function* () {
// let share = SDKCenter.getShare();
// share.title = ShareNormal;
// share.imageUrl = ShareImgUrl;
// let a = yield share.shareAppMessage();
// console.log(a);
// });
修改后正常代码
async onShareClick() {
let share = SDKCenter.getShare();
share.title = ShareNormal;
share.imageUrl = ShareImgUrl;
let a = await share.shareAppMessage();
console.log(a);
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自: