antd react实现上传文件进度条

进度条组件进度条 Progress - Ant Design

percent是进度显示百分比

//进度条

获取进度条百分比

在ajax里面写这个方法把获取到的数放到state里面然后再传到进度条组件里面就好了

onUploadProgress :(progressEvent)=>{
          //进度
          let downloading = (Math.round(progressEvent.loaded / progressEvent.total * 100))
          console.log(downloading);
          this.setState({downloading:downloading})
      }

你可能感兴趣的:(react.js,前端)