例如第二个请求里参数,是从第一个接口中拿到的
async getOrderDto() {
await this.$get("url" + this.dataId)
.then(data => {
if (data) {
this.orderDto = data;
}
})
.catch(error => {
});
await this.$get("url" + this.orderDto.orderTypeId)
.then(orderType => {
})
.catch(error => {});
},
created(){
this.getOrderDto()
}
这样会第一个请求全部执行完,再去执行第二个请求,以此类推,若嵌套多层都可以用这种方法
5842

被折叠的 条评论
为什么被折叠?



