[Vuejs]-Push array from backend to vuex store not working

0👍

The problem is that state is an object, not an array. But you can add an array property to the state and store your data there:

{
  state: {
    boards: []
  },

  mutations: {
    ADD_BOARDS (state, payload) { 
      state.boards.push(payload) 
    }
  }
}

Leave a comment