I
I
Ilya2017-08-20 09:44:51
Vue.js
Ilya, 2017-08-20 09:44:51

Why doesn't Vue flip the store?

Hello everyone, I've run into the following problem. When the store is initialized in the main component, it is visible, but not in the child ones, what am I doing wrong?
Point of entry:

import Vue from 'vue/dist/vue'
import { store } from './store/index';

import PopupWrapper from './components/PopupWrapper/PopupWrapper.vue'
import PopupCallback from './components/PopupCallback/PopupCallback.vue'

new Vue ({
  store,
  el: '#app',
  components: {
    PopupWrapper, PopupCallback,
  }
})

Storage file:
import Vue from 'vue/dist/vue';
import Vuex from 'vuex';

Vue.use(Vuex);

import { PopupWrapper } from '../components/PopupWrapper/PopupWrapper.store'
import { PopupCallback } from '../components/PopupCallback/PopupCallback.store'

export const store = new Vuex.Store({
  modules: {
    PopupWrapper,
    PopupCallback
  }
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-08-20
@ilyapashkov02

Add to entry point:

import Vuex from 'vuex';
Vue.use(Vuex);

And remove from the store:
Vue.use(Vuex);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question