Answer the question
In order to leave comments, you need to log in
Vue this.$store undefined?
import Vuex from 'vuex';
import state from './state';
import actions from './actions';
import getters from './getters';
import mutations from './mutations';
import modules from './modules';
import plugins from './plugins';
const store = () => {
return new Vuex.Store({
modules,
state,
mutations,
actions,
getters,
plugins,
});
};
export default store;
....
import store from './store';
new Vue({
store,
router,
render: h => h(App), // в компонентах this.$store undefined
}).$mount('#app');
const state = {
lang: 'en',
};
export default state;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question