Whether the value of vue.js dispatch () can be passed to the corresponding method of action.

for example:
this.$store.dispatch ("goods/addgoods", product);
where product is a commodity object, can it be passed to the method in action, and how does the method in action accept the projduct variable?
and call the commit method?

Apr.05,2021

Yes,
state.js test: 0
type.js export const TEST = 'TEST'
mutations.js import * as types from type.js TEST: (state, payload) = > {state.test = payload}
actions.js import * as types from type.js TEST: ({commit}, payload) = > {commit (types.TEST, payload)}, is that right?

Menu