Giter Site home page Giter Site logo

添加对上传文件的监听 about umi-request HOT 23 OPEN

umijs avatar umijs commented on July 20, 2024 4
添加对上传文件的监听

from umi-request.

Comments (23)

ifyour avatar ifyour commented on July 20, 2024 5

这个是不是要在 README.md 中特性部分进行体现呢 😂,暂时没有实现 axios onUploadProgress 以及 XMLHttpRequest: progress event

from umi-request.

clock157 avatar clock157 commented on July 20, 2024 3

有一个 issue 在跟进中,但现在还没有实现,我会继续关注。 whatwg/fetch#607

from umi-request.

GuoBinyong avatar GuoBinyong commented on July 20, 2024 3

使用中间件 umi-request-progress可完美解决上传进度和下载进度的问题,步骤如下:

  1. 安装 npm install umi-request-progress;
  2. 使用:
//导入 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)
   },
});

from umi-request.

quicklearning123 avatar quicklearning123 commented on July 20, 2024 1

+3

from umi-request.

elaoshi avatar elaoshi commented on July 20, 2024

有什么新进展么?

from umi-request.

laosandegudai avatar laosandegudai commented on July 20, 2024

有进展么?

from umi-request.

laosandegudai avatar laosandegudai commented on July 20, 2024

这个可以customRequest自定义上传然后用OnProgress控制进度,虽然文档没写但是有个这个OnProgress方法的。

from umi-request.

Hnnphone avatar Hnnphone commented on July 20, 2024

这个可以customRequest自定义上传然后用OnProgress控制进度,虽然文档没写但是有个这个OnProgress方法的。

问题是你怎么去拿进度,而不是用进度。。。

from umi-request.

laosandegudai avatar laosandegudai commented on July 20, 2024

这个可以customRequest自定义上传然后用OnProgress控制进度,虽然文档没写但是有个这个OnProgress方法的。

问题是你怎么去拿进度,而不是用进度。。。

都自己上传了还拿不到进度?

from umi-request.

America-first-melon avatar America-first-melon commented on July 20, 2024
  • 1

from umi-request.

zywkuo avatar zywkuo commented on July 20, 2024

+1

from umi-request.

jiangqidu avatar jiangqidu commented on July 20, 2024

有进展吗?都多久了

from umi-request.

GuoBinyong avatar GuoBinyong commented on July 20, 2024

有进展吗

from umi-request.

silentcloud avatar silentcloud commented on July 20, 2024

+1

from umi-request.

mabel-xue avatar mabel-xue commented on July 20, 2024

+1

from umi-request.

jin-benben avatar jin-benben commented on July 20, 2024

+2

from umi-request.

gs600981 avatar gs600981 commented on July 20, 2024

+4

from umi-request.

lihao6666 avatar lihao6666 commented on July 20, 2024

+5

from umi-request.

xiaoyc-9364 avatar xiaoyc-9364 commented on July 20, 2024

+6

from umi-request.

AugusQiu avatar AugusQiu commented on July 20, 2024

+7

from umi-request.

HeidaLay avatar HeidaLay commented on July 20, 2024

+8

from umi-request.

gezhicui avatar gezhicui commented on July 20, 2024

+9

from umi-request.

fandepeng1993 avatar fandepeng1993 commented on July 20, 2024

+10

from umi-request.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.