Skip to content

Instantly share code, notes, and snippets.

@daanfl
Created May 27, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daanfl/2cd89d5c19b207dfa4f646757bfc89b1 to your computer and use it in GitHub Desktop.
Save daanfl/2cd89d5c19b207dfa4f646757bfc89b1 to your computer and use it in GitHub Desktop.
export const actions = {
getProducts(context) {
this.axios.get('/api/products')
.then((response) => {
let products = response.data.data;
context.commit('setProducts', products);
});
},
addProduct(context, product) {
context.commit('addProduct', product);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment