pablocattaneo
3/15/2019 - 8:49 PM

How to use

If you are using the Modules mode of the Vuex store, only the primary module (in store/index.js) will receive this action. You'll need to chain your module actions from there.

export const state = () => ({
  categories: []
});

export const mutations = {
  setCategories(state) {
    state.categories = [
      "Pablo",
      "Automotor",
      "Compras",
      "Vinotecas y bodegas",
      "Cuidado Personal",
      "Educación",
      "Electro & Tecnología",
      "Entretenimiento",
      "Espectáculos",
      "Gastronomía",
      "Heladerías",
      "Hogar",
      "Jugueterías",
      "Mascotas",
      "Moda",
      "Supermercado",
      "Viajes y Turismo"
    ];
  }
};
export const actions = {
  nuxtServerInit({ commit }) {
    commit("categories/setCategories");
  }
};