Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ac-upload

Package Overview
Dependencies
Maintainers
15
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ac-upload

tinper-bee ac upload components

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
15
Weekly downloads
 
Created
Source

AC-Upload

npm version NPM downloads

1. 简介

基于tinper-bee组件库封装开发

手动上传组件,可以帮助你打开一个模态框选择文件进行上传、也包括拖拽式的上传方式,支持单个文件以及多个文件一起上传使用,上传完毕后,组件会显示查看附件信息

2. 安装

  • 通过npm下载使用 npm install ac-upload -S

3. 使用

通过ES6的方式进行加载使用

import AcUpload from 'ac-upload';//加载组件
import 'ac-upload/build/ac-upload.css';//加载组件样式

然后在render使用的时候传入相应组件需要的参数:

注:只要放在AcUpload组件之间的一个按钮即可

<AcUpload
    title="图片上传"
    action="/iuap_pap_quickstart/fileMananger/fastDfs/imgUpload"
    name="filelist[]"
    data={{ "other": "params" }}
    accept="image/*"
    multiple={true}
    onError={(err) => console.log(err)}
    onSuccess={(data) => console.log(data)}
>
    <Button shape="border" colors="info">图片上传</Button>
</AcUpload>

4. API

序号参数类型说明
1titlestring打开上传的模态框显示的标题文字
2defaultFileListobject[]默认已经上传的文件列表
3multiplebool是否允许多选,选择附件可以使用shift多选。设置单选后窗体会自动上传完成后关闭
4actionstring必选参数, 上传的地址
5acceptstring接受上传的文件类型, 详见 input accept Attribute
6dataJSON随着上传的时候附加一些参数,接收JSON对象
7namestring上传设置的参数file名字默认files[]
8onSuccessfunction上传成功后的回调,返回所有response
9onErrorfunction上传失败后的回调,用于处理后续失败操作
10maxSizenumber附件限制大小
11onDeletefunction删除的时候触发的回调参数为file对象

Keywords

FAQs

Package last updated on 23 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc