Axios上传进度

javascript
阅读 35 收藏 0 点赞 0 评论 0

progress.js
let config = {
  onUploadProgress: progressEvent => {
    let percentCompleted = Math.floor((progressEvent.loaded * 100) / progressEvent.total);
    // do whatever you like with the percentage complete
    // maybe dispatch an action that will update a progress bar or something
  }
}

axios.post('/path/to/post/', data, config)
        .then(response => console.log(response));
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号