# [Vue.js] Cant get specific data from vuex in components

I can get all data from vuex except only one and what surprise me more is I can get data in Chrome, only in Chrome.

Already tried different approaches, switch between localstorage and vuex-persistedstate, still can’t figure it out.

This is my vuex state:

state: {
statusOptions:JSON.parse(localStorage.getItem(‘optionsStatus’)),
},

Axios request:

axios({
url: ‘http://10.80.101.187:8081/api/directory/presencestatus',
method: ‘POST’,
})
.then((resp) => {
console.log(resp.data)
localStorage.setItem(‘optionsStatus’,JSON.stringify(resp.data));
});

this.$store.state.statusOptions try to catch data in components That’s how I get data from server and send it to vuex. In console I can check that I got data from server and also I can see it in vuex , but its empty in components. 0: {id_ref_catalog: 392, rus_name_catalog: “here”} 1: {id_ref_catalog: 393, rus_name_catalog: “diner”} 2: {id_ref_catalog: 394, rus_name_catalog: “away”} Also to save data from vuex while refresh I use a plugin vuex-persistedstate ### Solution : You should use the vuex in the right form. Use a mutation, an action. Set the initial state to statusOptions: [] and then you will dispatch a mutation which will trigger an action and that action should commit the changes to the vuex store with the values from the response from the API. state: { statusOptions: [] } then you should an action mutations: { update (state, payload) { state.statusOptions = payload } }, actions: { getDataFromAPI() { return axios({ url: ‘http://10.80.101.187:8081/api/directory/presencestatus', method: ‘POST’, }); } And then in the mounted() method, you can call mounted() { this.getDataFromAPI().then( resp => { this.$store.commit(‘update’, JSON.stringify(resp.data))})
}

It’s some sort of an example. It’s not the right syntax, but give it a try.