o***@gmail.com
o***@gmail.com
  • 发布:2020-01-21 03:28
  • 更新:2021-09-09 11:17
  • 阅读:1419

在应用onLaunch时,执行this.$scope.globalData.temp = "temp"; 为啥在H5端直接抛异常呢?

分类:HTML5+

抛异常的是这句:
this.$scope.globalData.user = “user”;

2020-01-21 03:28 负责人:无 分享
已邀请:
o***@gmail.com

o***@gmail.com (作者)

异常信息:

index.umd.min.js:1 [system] TypeError: Cannot read property 'globalData' of undefined
at Vue.onLaunch (App.vue:59)
at invokeWithErrorHandling (vue.runtime.esm.js:1865)
at Vue../node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js.Vue.__call_hook (vue.runtime.esm.js:8542)
at a (index.umd.min.js:1)
at Vue.mounted (index.umd.min.js:1)
at invokeWithErrorHandling (vue.runtime.esm.js:1865)
at callHook (vue.runtime.esm.js:4230)
at mountComponent (vue.runtime.esm.js:4097)
at Vue../node_modules/@dcloudio/vue-cli-plugin-uni/packages/h5-vue/dist/vue.runtime.esm.js.Vue.$mount (vue.runtime.esm.js:8558)

c***@foxmail.com

c***@foxmail.com

+1,不过我是在 APP 端遇到的,楼主解决了吗?

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