VUEX採坑の道は$storeの解決方法が得られません。

1685 ワード

今日はvuexを書いていますが、特に無口な問題に遭いました。30分ぐらい探してやっとこの問題を見つけました。ですから、貼り付けました。みんなは私と同じ問題に遭遇した時、慌てすぎません。
vuexを初めて書く時はどうしても$storeが取れませんでした。長い間探してみましたが、私がグローバルVUEに注入した時に注入したのはStoreで、storeではなくStoreです。
この文字の差は大丈夫そうですが、全体の$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の解決方法がないです。小編集が皆さんに提供した内容は全部分かります。参考にしてほしいです。どうぞよろしくお願いします。