1// If you want to use state in action when using Vuex store
2// all you need is to add 'state' next to commit in curly bracket '{ }'
3
4// Exapmle:
5
6someAction({commit, state}){
7 axios.get("https://myUrl.com/" + state.version )
8 .then((response) => {
9 commit('champions', {
10 champions: response.data.data
11 })
12 })
13 .catch(function (error) {
14 console.log(error);
15 })
16 }
17
1actions: {
2 actionName ({ commit, state }, payload) {
3 console.log(state)
4 }
5}