vuex2 mapActions 报错 `unknown action type: xxxx`

 
   
export const setBreadCrumb = ({ dispatch }, data) => {
    dispatch('SET_BREADCRUMB', data)
}

 


当调用的时候报[vuex2] mapActions 报错 `unknown action type:
setBreadCrumb`

后台改成
export const setBreadCrumb = ({ commit }, data) => {
    commit('SET_BREADCRUMB', data)
}

未报错

转载于:https://www.cnblogs.com/garfieldzhong/p/7568353.html

你可能感兴趣的:(vuex2 mapActions 报错 `unknown action type: xxxx`)