Skip to content

Instantly share code, notes, and snippets.

@pablocattaneo
Created March 15, 2019 20:49
Show Gist options
  • Save pablocattaneo/fba4aa7339d6039fca06417ad24e665e to your computer and use it in GitHub Desktop.
Save pablocattaneo/fba4aa7339d6039fca06417ad24e665e to your computer and use it in GitHub Desktop.
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");
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment