[Vuejs]-Why is my initial state in vuex store undefined?

0👍

This is wired got it fixed with adding state:

export const module = {
namespaced: true,
state: state,
  getters: {

    getSomethingArray: (state: State) => {

      return state.something;
    },

  },
  mutations: { 

    resetState: (s: State) => {
      const initial = state;
      Object.keys(initial).forEach(key => { s[key] = initial[key]; });
    },
  }
  actions: {///}
}

Leave a comment