1.0.4 • Published 5 years ago

@aligov/mobile-c-upload v1.0.4

Weekly downloads
3
License
MIT
Repository
-
Last release
5 years ago

@aligov/mobile-c-upload

Install

$ npm install @aligov/mobile-c-upload --save

Usage

import MobileCUpload from '@aligov/mobile-c-upload';

API

Props

nametypedefaultdescribe
fileListIFile[]''文件列表
limitnumberInfinity最大文件上传个数

IFile

nametypedefaultdescribe
uidstring''文件唯一标识
thumbUrlstring''缩略图
sizestring''文件大小
urlstring''文件 URL 地址
statusstring''可选值:fail, success, uploading, removed enum
percentnumber进度(1-100)
canRemoveboolean是否可被删除

Function

nameparamreturndescribe
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 });