npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beisen/FormUploader

v0.1.64

Published

form file image uploader

Readme

FormUploader

  • ie10以上/Ajax2 支持完美

参数

props

hidden: false, // 是否渲染 默认false
disabled: false, // 是否禁用 默认false
status: 'edit', // 显示状态 edit 编辑态 show 显示态
hasLoadFile: [], // 已经上传的文件 show状态下 显示文件
labelText: '', // 左侧文字
labelTip: '', // 右侧提示信息
url: '', // 上传地址
acceptData: '', // input accept data
multiple: false,
fileInputName: '', // input[type='file']的name
fileSize: '2mb',// mb kb b 
fileType: [], // 提供文件验证类型 默认['jpeg','JPEG','pdf','PDF','docx','DOCX','xlsx','XLSX','ppt','PPT','rar','RAR','txt','TXT','xls','XLS','doc','zip','ZIP','jpg','JPG','gif','GIF','png','PNG','pptx','PPTX','mmap','MMAP']
onceUploadCount: 2, // multiple时 一次可选的文件数量
allUploadConut: 2, // 总共文件上传数量
extendData: {}, // key-value
isDrag: true,  // 拖拽默认有 默认true
onSuccess: (event, response) => console.log(event, response), // 上传成功 参数 ajax event , response
onFailure: (event, response) => console.log(event, response), // 上传失败 参数 ajax event , response
onProgress: (event) => console.log(event), // 上传过程回调 event ajax事件对象
onDragOver: (event) => console.log(event), // 文件拖至区域 event
onDragLeave: (event) => console.log(event), // 文件离开区域 event 
onDrop: (event) => console.log(event), // 拖至区域 event 
onDelete: (file) => console.log(file) // 删除文件

使用方法

1.安装npm组件包

npm install @beisen/FormUploader --save-dev

2.引用组件

import FormUploader from "@beisen/FormUploader"

3.传入参数

该参数为上述参数,传入方式使用: {...参数}

this.state = {
  // required: true,
  labelText: '附件', // 左侧文字
  labelTip: '单个附件最大不超过10M', // 右侧提示信息
  multiple: true,
  url: 'http://localhost:8080/sywwg/zhong',
  status: 'edit',
  extendData: {
    name: 'zz'
  },
  acceptData: 'image/JPG, image/png, image/jpeg, image/bmp, image/gif, image/tif',
  fileInputName: 'upload',
  fileType: [],
  // hasLoadFile: Data,
  fileSize: "1Mb",
  hidden: false,
  disabled: false,
  required: true,
  onceUploadCount: 3,
  allUploadConut: 6,
  previewText: '下载',
  errorType: "1", //"0"是按钮下方的提示信息,"1"是文件列表下方的提示信息
  errorMessage: "你传的这个东西不对!", //错误信息
  errorShow: true, //true时显示错误信息,false时不显示
  onSuccess: (event, response, allFiles) => console.log(event, response, allFiles), // 发送数据成功返回回调 event ajax事件对象 response 当前上传成功的响应 allFiles 所有上传的文件
  onFailure: (event) => console.log(event), // 请求错误回调 event ajax事件对象
  onProgress: (event) => console.log(event), // 请求过程回调 event ajax事件对象
  onDragOver: (event) => console.log(event), // 文件拖至区域 event
  onDragLeave: (event) => console.log(event), // 文件离开区域 event 
  onDrop: (event) => console.log(event), // 拖至区域 event
  onDelete: (file) => console.log(file) // 删除文件
}

render() {
  const {
    status
  } = this.state;
  return (
    <div>
        <App {...this.state}>
          
        </App>
        {/*<progress value='100' max="100"></progress>
        <button onClick={::this.changeStatus}>change</button>*/}    
    </div>
  )
}