yb98k-upload-re
v1.0.2
Published
Don't want to describe
Downloads
2
Readme
Install
# npm 安装方式
npm i yb98k-upload-re
# yarn 安装方式
yarn add yb98k-upload-re
Usages
import YbUpload from 'yb98k-upload-re';
render() {
const uploadUrl = 'xxxxxx';
const uploadPartUrl = 'xxxxxx';
...
return (
<YbUpload acceptTYpe={'.mp4'}
limitFileCount={10}
limitSize={'10G'}
partSize={'10M'}
msgBack={(code, msg, url) => {console.log(msg)}}
isUseOriginName={true}
uploadPart={true}
uploadUrl={uploadUrl}
uploadPartUrl={uploadPartUrl}/>
)
}
Params desc
uploadUrl:正常文件上传的地址
uploadPartUrl:分片上传的地址
accept:可以选择的文件类型, 原生注入
modal:上传按钮形式 1: 常用按钮 2: 美化版
multiple:布尔型,是否支持多文件
limitFileCount:多文件时支持最多选择多少个文件
limitSize:限制每个文件最大是多大
uploadPart:是否开启分片
partSize:分片的每片大小
isUseOriginName:上传文件名是否使用原始文件名称
fileCheck:进行文件名称校验相关逻辑,是个函数,传了就会执行
msgBack:上传组件传递给父组件的事件,包含上传后的code码、url和msg信息