1.0.4 • Published 6 years ago
@aligov/mobile-c-upload
Install
$ npm install @aligov/mobile-c-upload --save
Usage
import MobileCUpload from '@aligov/mobile-c-upload';
API
Props
| name | type | default | describe |
|---|
| fileList | IFile[] | '' | 文件列表 |
| limit | number | Infinity | 最大文件上传个数 |
IFile
| name | type | default | describe |
|---|
| uid | string | '' | 文件唯一标识 |
| thumbUrl | string | '' | 缩略图 |
| size | string | '' | 文件大小 |
| url | string | '' | 文件 URL 地址 |
| status | string | '' | 可选值:fail, success, uploading, removed enum |
| percent | number | | 进度(1-100) |
| canRemove | boolean | | 是否可被删除 |
Function
| name | param | return | describe |
|---|
| onChange | (file: IFile[]) => void | / | 上传文件改变时的状态 |
| onRemove | (file: IFile[]) => void | / | 移除文件回调函数 |
| onPreview | (file: IFile[]) => void | / | 点击图片回调 |
Example
import { createElement, render } from 'rax';
import DriverUniversal from 'driver-universal';
import MobileCUpload from '@aligov/mobile-c-upload';
render(<MobileCUpload />, document.body, { driver: DriverUniversal });