[Vuejs]-Getting data from store actions in nuxt.js

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.

👤Puwka

Leave a comment