Vuex 中 使用 Action 处理异步请求时,常规写法以下:html
getMenuAction:(context) =>{ context.commit('SET_MENU_LIST',['承保2','核保2']) } }
咱们也可使用以下简化写法,以下:异步
actions:{ getMenuAction:({commit}) =>{ commit('SET_MENU_LIST',['承保2','核保2']) } }
参照原文章post
https://www.cnblogs.com/xianrongbin/p/2781659.htmlurl