FrontendDeveloper.in

Vue.js question detail

Can you dispatch an action using payload or object style?

Yes, actions support both payload and object style format similar to mutations.

// dispatch with a payload
store.dispatch('incrementAsync', {
amount: 10
})

// dispatch with an object
store.dispatch({
type: 'incrementAsync',
amount: 10
})
Back to all Vue.js questions
Get LinkedIn Premium at Rs 399