日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

for循環調用接口返回的數據放在同一個列表中

作者:小白d 更新時間: 2022-01-11 編程語言
 
    querysqfaxx() {
      const params = {
        salesId:1,
      }
      this.$axios.get(this.api.salesSupport.querySalesPlans, {params}).then((res) => {
        this.commonGetResData(res).then(data => {
          this.sqfaxxidData = data;
          const list = []
          for(let i of this.sqfaxxidData){
            const params = {
              id:i.planid
            }
            list.push(this.$axios.get(this.api.plan.queryPlanById, {params}))
          }
                Promise.all(list).then(ress => {
                this.sqfaxxData=ress
              })
        });
      });
   }

原文鏈接:https://blog.csdn.net/weixin_57166067/article/details/122100406

欄目分類
最近更新