TypeError: Cannot read properties of undefined (reading ‘state‘)

2022年7月1日12:16:15

写个刚好写个项目中要用到vuex在app里面挂载了一个player组件
main.js里也引用了这个store文件但报了一个Error in render: "TypeError: Cannot read properties of undefined (reading ‘state’)

import Storefrom'./store/index'import Vuefrom'vue'import Appfrom'./App.vue'import routerfrom'./router'import'./style/reset.css'// 引入重置样式import axiosfrom'./Utils/axios'import VueLazyloadfrom'vue-lazyload'// 将axios挂载到vue的原型上 组件继承实例
Vue.config.productionTip=falseVue.prototype.$axios= axios// 图片的懒加载
Vue.use(VueLazyload,{
  preLoad:1.3,
  error:'../public/favicon.ico',
  loading:'../public/favicon.ico',
  attempt:1});newVue({
  router,
  Store,render:h=>h(App)}).$mount('#app')

原因是这个store大写了,具体原因不太清楚,希望有大神能告知。

  • 作者:bug售卖机
  • 原文链接:https://blog.csdn.net/qq_53008149/article/details/118888843
    更新时间:2022年7月1日12:16:15 ,共 610 字。