慕妹3242003
axios可以获取上传或下载进度的,请看看请求配置下的这两个方法:requestconfigonUploadProgress:function(progressEvent){//Dowhateveryouwantwiththenativeprogressevent},//`onDownloadProgress`allowshandlingofprogresseventsfordownloadsonDownloadProgress:function(progressEvent){//Dowhateveryouwantwiththenativeprogressevent},我试过是可以的,以前写的代码:this.axios({method:'POST',url:this.url,data:fmData,params:this.params,transformRequest:function(data){returndata},onUploadProgress:function(progressEvent){vm.$nextTick(function(){if(progressEvent.total===0){vm.percentage=0}else{vm.percentage=Math.round(progressEvent.loaded*100/progressEvent.total)}})}})