Vuejs and Webpack: Why is store undefined in child components
问题 I am using Vuejs with Webpack. Here's store.js: import Vuex from "vuex"; export default new Vuex.Store({ state: { count : 0 }, mutations: { increment (state) { state.count++ } } }); Here is my app.js: "use strict"; import Vue from 'vue'; window.Vue = Vue; import MyComponent from './MyComponent.vue'; import store from './store.js'; window.App = new Vue({ el : '#my-app', store, components : { 'my-component' : MyComponent } }); Here is the script from MyComponent.vue: export default { computed :