README
TL;DR
uxcore-rc-upload ui component for react
setup develop environment
$ git clone https://github.com/uxcore/uxcore-rc-upload
$ cd uxcore-rc-upload
$ npm install
$ gulp server
Usage
demo
http://uxcore.github.io/uxcore/
API
props
配置项 | 类型 | 必填 | 默认值 | 功能/备注 |
---|---|---|---|---|
action | string | required | - | 上传文件的地址 |
buttonSize | string | optional | medium | 上传按钮的尺寸大小 |
name | string | optional | - | 上传文件的名字 |
data | object | optional | - | 上传附件时随附件一起出入的参数 |
onStart | function | optional | - | 上传开始前出发 |
onError | function | optional | - | 出错时触发 |
onSuccess | function | optional | - | 上传完成时触发 |
onProgress | function | optional | - | 上传中触发 |
multiple | function | optional | false | 是否支持多文件上传,只支持到 IE10+ |
buttonText | string | optional | '点击上传' | 点击上传 |
onStart 传入参数
- file upload file object
onError 传入参数
- err: request error message
- responce: request responce, not support on iframeUpload
- file: upload file object
onSuccess 传入参数
- result: response data
- file: upload file object
onProgress 传入参数
- step: XMLHttpRequestProgressEvent
- file: upload file object