0👍
Though, this does not solve the actual problem (getter is not updated on commit) – this workaround forces Vuex to re-initialize the entire state.
I have added this code in an axios ajax response handler, which occurs only once per session:
commit('SERVER_DETAILS', data)
$store.hotUpdate($store.state) // <<-- This line is new.
0👍
You are using the Vuex state wrong, it should be an object.
const state = {
serverDetails: {},
}
- [Vuejs]-Auth0 access token to API works in postman but not when calling from Vue
- [Vuejs]-Getting rest api data into bootstrap Vue table and pagination
Source:stackexchange.com