nuxt vuex structure
// File path: store/index.js
Vue.use(Vuex)
export const state = () => ({
// this is a object
})
// this is to change state
export const mutations = {
someFunc(state, payload){
// code
}
}
export const getters = {
}
// server-side interaction
export const actions = {
someFunc(context, payload){
// code
},
someFunc2({commit, getters}, data){
// code
}
}