antd-mobile-upload
项目介绍
基于 rc-upload 和 antd-mobile 的上传组件
软件架构
适用于 dva 和 umi 项目
安装教程
yarn add antd-mobile-upload
或者
npm i -S antd-mobile-upload
使用说明
文件上传示例
import React PureComponent from 'react';import Upload from 'antd-mobile-upload'; { return <Upload = /> ; }
图片上传示例
import React PureComponent from 'react';import ImageUpload from 'antd-mobile-upload/lib/ImageUpload'; { return <ImageUpload = /> ; }
API
; const Upload = // 原 rc-upload 属性 component: PTstring style: PTobject prefixCls: PTstring action: PT name: PTstring multipart: PTbool directory: PTbool onError: PTfunc onSuccess: PTfunc onProgress: PTfunc onStart: PTfunc data: PT headers: PTobject accept: PTstring multiple: PTbool disabled: PTbool beforeUpload: PTfunc customRequest: PTfunc onReady: PTfunc withCredentials: PTbool supportServerRender: PTbool openFileDialogOnClick: PTbool // upload 补充属性 files: PTisRequired // 当前文件列表 size: PTnumber // 单个文件大小 limit: PTnumber // 文件上传数量 onRemove: PTfunc // 移除文件回调 onClickFile: PTfunc // 点击文件回调 onComplete: PTfunc // 上传完成回调 getSuccessFileUrl: PTfunc // 定义获取上传成功文件的url函数 renderFilesContainer: PTfunc // 文件列表容器组件 renderFileUploaded: PTfunc // 已上传文件组件 renderFileUpload: PTfunc // 上传触发组件; ;