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

ac-upload

Package Overview
Dependencies
Maintainers
1
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.0.7
  • Source
  • npm
  • Socket score

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

AC-Upload

npm version NPM downloads

1. 简介

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

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

image

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打开上传的模态框显示的标题文字
2multiplebool是否允许多选
3actionstring必选参数, 上传的地址
4acceptstring接受上传的文件类型, 详见 input accept Attribute
5dataobject随着上传的时候附加一些参数,接收JSON对象
6namestring上传设置的参数file名字默认files[]
7maxSizenumber上传附件大小限制,默认10MB
8onSuccessfunction上传成功后的回调,回调参数数组对象包含本次上传后的完成路径以及修改后的名称[{"accessAddress":"http://10.10.24.43:8080/wbalone/images/5441cbb2-27e6-4a9d-98b3-448f3f78de55_.png","fileName":"5441cbb2-27e6-4a9d-98b3-448f3f78de55_.png"}]
9onErrorfunction上传失败后的回调,用于处理后续失败操作

Keywords

FAQs

Package last updated on 03 Jul 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