axios.all([

    axios.get('https://api.github.com/xxx/1'),

    axios.get('https://api.github.com/xxx/2')

  ])

  .then(axios.spread(function (userResp, reposResp) {

    // 上面两个请求都完成后,才执行这个回调方法

    console.log('User', userResp.data);

    console.log('Repositories', reposResp.data);

  }));

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2023-03-14
  • 2021-06-02
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-18
  • 2022-02-11
  • 2022-12-23
  • 2022-02-08
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案