[Vuejs]-Using vuejs new vuex store getting unexpected config error

0👍

The answer was hidden in the tutorial. I was using the example portion to recreate the store but it had missed the Vue.use(Vuex) it wasnt until much later in the document that they mentioned this information.

0👍

import Vue  from 'vue'
import Vuex from 'vuex'
import calendarHeader   from './components/Header.vue'
import calendarSettings from './components/Settings.vue'
import calendarContent  from './components/Contents.vue'

// You have to "install" Vuex
// http://vuejs.org/api/#Vue-use
Vue.use(Vuex)

const state = {
    count: 0
}

const mutations = {
    INCREMENT(state) {
        state.count++
    }
}

const store = new Vuex.Store({
    state,
    mutations
});

Leave a comment