0👍
If I guessed right, your this.$store.commit('getPages')
commits mutation without payload, like this.$store.commit('getPages', undefined)
. You should dispatch your action instead of commiting the mutation. this.$store.dispatch('fetchData')
. And also create getter in Vuex:
getters: {
getPages(state) {
return state.pages
}
}
Hope it will be helpful.
Source:stackexchange.com