-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加对上传文件的监听 #34
Comments
有一个 issue 在跟进中,但现在还没有实现,我会继续关注。 whatwg/fetch#607 |
这个是不是要在 README.md 中特性部分进行体现呢 😂,暂时没有实现 axios |
有什么新进展么? |
有进展么? |
这个可以customRequest自定义上传然后用OnProgress控制进度,虽然文档没写但是有个这个OnProgress方法的。 |
问题是你怎么去拿进度,而不是用进度。。。 |
都自己上传了还拿不到进度? |
|
+1 |
有进展吗?都多久了 |
有进展吗 |
+1 |
1 similar comment
+1 |
+2 |
+3 |
+4 |
+5 |
+6 |
+7 |
+8 |
+9 |
使用中间件 umi-request-progress可完美解决上传进度和下载进度的问题,步骤如下:
//导入 umi-request
import request from 'umi-request';
//导入 umi-request-progress
import progressMiddleware from 'umi-request-progress';
// 注册内核中间件
request.use(progressMiddleware, { core: true });
// 上传文件
request("/file/upload",{
...otherOptions,
//上传进度事件的回调函数
onReqProgress:function( ev: ProgressEvent){
console.log(ev)
},
//下载进度事件的回调函数
onResProgress:function( ev: ProgressEvent){
console.log(ev)
},
}); |
+10 |
+11 |
umi-request是基于fetch的封装,当上传文件时,如何对上传文件的进度进行监听呢,像xhr.upload.onprogress
The text was updated successfully, but these errors were encountered: