2***@qq.com
2***@qq.com
  • 发布:2020-04-22 14:20
  • 更新:2020-04-22 14:42
  • 阅读:1533

uniapp onShow 报错

分类:uni-app

onShow: () => {
// #ifdef APP-PLUS
this.version = plus.runtime.version;
this.doCheckVersion1(this.version);
// #endif
}
onShow() {
// #ifdef APP-PLUS
this.version = plus.runtime.version;
this.doCheckVersion1(this.version);
// #endif
}
上面两种格式的onShow,为什么第一种会报错: TypeError: undefined is not an object (evaluating '
第二种不会报错

2020-04-22 14:20 负责人:无 分享
已邀请:
x***@qq.com

x***@qq.com - 疑问?的小纳?

第二种为简写方式是正确的。第一种后面要跟function,不能用箭头函数

该问题目前已经被锁定, 无法添加新回复