Vuex get state data from a .js file in nuxtjs

Viewed 17

I'm developing a project for a campaign, where there will be a game. Within the final screen of the game, I will send a request to the backend, sending some information. This information is saved in the vuex state. But I am not able to access this data.

In fact, I did it in a way. Importing file and calling state function. However, it does not return the current data, but the value at which the application is started.

Can someone please help me with this?

If there is any relationship, I'm using nuxtjs and the game in phaser 3

Vuex

export const state = () => ({
  token: null,
  data: {}
})

export const getters = {
}

export const mutations = {
  SET_TOKEN(state, payload){
    state.token = payload;
  },

  SET_FORM(state, payload){
    state.data = payload;
  }
}

export const actions = {
}
0 Answers
Related