0 votes
in VueJS by

Can you dispatch an action using payload or object style?

1 Answer

0 votes
by

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
})
...