-1👍
I have not been able to test this as I am on my tablet, but think what you want is the following. In the calling component:
this.$store.dispatch({
type: ‘addToCart’,
row: row
})
In your store actions:
addToCart ({commit, state}, payload) => {
console.log(`ROW: ${payload.row})
commit({
type: ‘mAddToCart’,
row: payload.row
})
})
The in your mutations:
mAddToCart((state, payload) => {
// Do what you need to do with payload.row
})
Hope that helps.
- [Vuejs]-Laravel_token is valid for first request but not subsequent requests
- [Vuejs]-Send 2 ajax POST request on single click
Source:stackexchange.com