the configuration related to vuex is as follows
< hr >const mutations = {
incrementment( state,payload ){
state.numb+= payload.amount;
},
reducement( state ){
state.numb-- ;
},
[SOME_MUTATION](){
state.numb+=10.98
}
}
const actions = {
actionIncrement({ commit }){
commit("incrementment")
}
}
const store = new Vuex.Store({
state,
getters,
actions,
mutations
})
< hr >
then call
in the component<button @click="actionHand()">Actions </button>
actionHand(){
this.$store.dispatch({
type:"actionIncrement",
amount:70
})
}
but report an error when clicking Cannot read property "amount" of undefined
ask the boss to answer