为什么axios onUploadProgress不起作用?

时间:2018-06-13 13:28:33

标签: javascript vuejs2 axios

可能会有人解释一下,我做错了什么?

这有效:

const res = await axios.post(this.url, body, { 
  headers: this.headersObj 
});

抛出错误:

const res = await axios.post(this.url, body, { 
  headers: this.headersObj, 
  onUploadProgress: progressEvent => { 
    console.log(progressEvent.loaded) 
  } 
})

enter image description here

谢谢!

0 个答案:

没有答案