您好,登錄后才能下訂單哦!
這篇文章主要介紹VUEX如何獲取不到$store,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
代碼奉上
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import App from './App' import router from './router' import font from './static/js/font.js'; import './static/scss/animate.css' Vue.config.productionTip = false import Store from './store/store.js'; /* eslint-disable no-new */ new Vue({ el: '#app', router, Store, components: { App }, template: '<App/>' })
我之前就是這么寫的,所以一直出不來,可是邏輯根本沒有問題
之后我把大寫的S換成了小寫的s就出來了
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import App from './App' import router from './router' import font from './static/js/font.js'; import './static/scss/animate.css' Vue.config.productionTip = false import store from './store/store.js'; /* eslint-disable no-new */ new Vue({ el: '#app', router, store, components: { App }, template: '<App/>' })
以上是“VUEX如何獲取不到$store”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。