Axios의 동시 요청 된 모든 작업의 완료에 대한 여러 요청 또는 정량적하지 기다립니다 전송

  • 동시에 복수의 요청을 송신

      Axios.all([request1, request2, request3])
          .then(
            Axios.spread((res1, res2, res3) => {
              console.log('全部加载完成')
            })
          )
          .catch(err => {
            console.log(err.response)
          });

    호출 모든 요청의 완료 후, 기능을 Axios.spread 및 데이터 매개 변수에 대응할 수있다 요청합니다.

    불확실한 요청을 보낼 때

    사용지도 Axios.all 결합

      Axios.all(arr.map(function (data)=>{
          return this.axios.post(....)
      }))
          .then(
            Axios.spread((...a) => {
              console.log('全部加载完成')
            })
          )
          .catch(err => {
            console.log(err.response)
          });

도착가요 배열 약속대로 복귀지도에있어서의 복수의 변경한다.

추천

출처www.cnblogs.com/Vayne-N/p/11704565.html