Vuex 中 使用 Action 处理异步请求时,常规写法如下:

  getMenuAction:(context) =>{
            context.commit('SET_MENU_LIST',['承保2','核保2'])
        }
    }

我们也可以使用如下简化写法,如下:

 actions:{
        getMenuAction:({commit}) =>{
            commit('SET_MENU_LIST',['承保2','核保2'])
        }
    }

参照原文章

https://www.cnblogs.com/xianrongbin/p/2781659.html

  Vuex 中 使用 Action 处理异步请求时,常规写法如下:

  getMenuAction:(context) =>{
            context.commit('SET_MENU_LIST',['承保2','核保2'])
        }
    }

我们也可以使用如下简化写法,如下:

 actions:{
        getMenuAction:({commit}) =>{
            commit('SET_MENU_LIST',['承保2','核保2'])
        }
    }

参照原文章

https://www.cnblogs.com/xianrongbin/p/2781659.html

相关文章:

  • 2021-07-10
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-04-02
  • 2021-08-18
猜你喜欢
  • 2021-07-28
  • 2021-06-26
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
相关资源
相似解决方案