我无法弄清楚为什么我会收到这个错误.一切看起来都很合适.像这样将商店导入组件.
import store from './store';
new Vue({
components: {
SomeComponent
},
store
});
Run Code Online (Sandbox Code Playgroud)
我的商店看起来像这样
import Vue from 'vue';
import Vuex from 'vuex';
import * as getters from './getters';
import * as actions from './actions';
import mutations from './mutations';
Vue.use(Vuex);
export default new Vuex.Store({
state: {
something
}
})
Run Code Online (Sandbox Code Playgroud)
请帮忙.谢谢
未捕获错误:[vuex]必须在创建商店实例之前调用Vue.use(Vuex).