kvker大前端
kvker大前端
  • 发布:2019-01-13 10:34
  • 更新:2019-04-19 17:29
  • 阅读:2731

【报Bug】Vuex的getters小程序下报错

分类:uni-app

抱歉,找到问题所在,uni的Vuex使用多一步:Vue.prototype.$store = store,之前没有加。

[已处理]
*[内容]
重现步骤
[步骤]使用Vuex的getter,导入mapGetters,启动报错:Cannot read property 'getters' of undefined;at "pages/index/index" page lifeCycleMethod onLoad function TypeError: Cannot read property 'getters' of undefined
Chrome下调试正常

IDE运行环境说明
[HBuilder 或 HBuilderX] 1.4.1 1228,hx
[mac版本号]10.14.2*

2019-01-13 10:34 负责人:无 分享
已邀请:
mzmuping

mzmuping

可以在main.js加上 Vue.prototype.$store = store

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