0
点赞
收藏
分享

微信扫一扫

成功解决:Cannot read properties of undefined (reading ‘commit‘)


我真无语,我严重怀疑我在main.js中删除Avue的引入时、顺带删除了store

文章目录

  • ​​1、报错信息​​
  • ​​2、报错原因​​
  • ​​3、解决方法​​
  • ​​4、成功解决​​

1、报错信息

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘commit’)
at VueComponent.mappedMutation (vuex.esm.js?358c:985:1)
at eval(Login.vue?03db:106:1)

2、报错原因

我的是在main.js中未引入配置的store

3、解决方法

加入配置的store

成功解决:Cannot read properties of undefined (reading ‘commit‘)_报错信息

4、成功解决

登录的同时需要进行token的存储、需要调用store中的方法进行token的存储,但是未在全局引入。所以在使用时、报错

成功解决:Cannot read properties of undefined (reading ‘commit‘)_解决方法_02


举报

相关推荐

0 条评论