Vuex报错‘__WEBPACK_IMPORTED_MODULE_1_vuex__.a.store is not a constructor’

爱被打了一巴掌 2023-07-24 05:35 109阅读 0赞

今天使用Vuex的时候突然报错了,康康官网是怎么搞得:

  1. const store = new Vuex.Store({
  2. state: {
  3. count: 0
  4. },
  5. mutations: {
  6. increment (state) {
  7. state.count++
  8. }
  9. }
  10. })

再康康我的:

  1. const store = new Vuex.store({
  2. state: {
  3. count: 0
  4. },
  5. mutations: {
  6. increment (state) {
  7. state.count++
  8. }
  9. }
  10. })

new Vuex.store的store的s大写,这真是疏忽

发表评论

表情:
评论列表 (有 0 条评论,109人围观)

还没有评论,来说两句吧...

相关阅读