vuex中action如何互相调用

时间:2020-02-04 20:52:48   收藏:0   阅读:593
homeInit({dispatch,commit,state}){//初始化
      return new Promise(resolve=>{
        dispatch("apiGetHuiYiId").then(function(data){
          console.log()
          if(!tools.isPC()&&data.huiyi_id=="140abcfa261011eab9780242ac170002"){
            window.location.href="http://onlinesys02.hoohui.cn/cms/app/2/index.jsp?mid="+data.mid;
            return;
          }
          dispatch("getHomeLeftContent",data.huiyi_id);//获取首页左侧内容
          dispatch("getHomeCenterContent",data.huiyi_id);//获取首页中间内容
          dispatch("getHomeContent",data.huiyi_id);//获取首页内容(右侧 lang template)
        }).then(function(data){
          resolve();
        })
      }) 
},//首页初始化

 

原文:https://www.cnblogs.com/fqh123/p/12260713.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!