nuxt vuex structure

Solutions on MaxInterview for nuxt vuex structure by the best coders in the world

showing results for - "nuxt vuex structure"
Axel
10 Nov 2016
1// File path: store/index.js
2Vue.use(Vuex)
3
4export const state = () => ({
5  // this is a object
6})
7// this is to change state
8export const mutations = {
9  someFunc(state, payload){
10    // code
11  }
12}
13export const getters = {
14}
15// server-side interaction
16export const actions = {
17  someFunc(context, payload){
18    // code
19  },
20  someFunc2({commit, getters}, data){
21    // code
22  }
23}
24