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 🙏

© 2024 – Pkg Stats / Ryan Hefner

upload-file-demo

v1.4.56

Published

upload 上传文件/文件夹。 基于 element ui 中 upload 封装,支持将文件上传到s3。

Downloads

34

Readme

upload 上传文件/文件夹。 基于 element ui 中 upload 封装,支持将文件上传到s3。

Attribute @props config {Object} 数据信息,示例: config: { class: 'upload-demo', // 说明: class; 类型: Stirng; action: '', // 说明: 必选参数,上传的地址; 是否必填: 必填; 类型: String; 默认: ''; headers: {}, // 说明: 设置上传的请求头部; 类型: Object; multiple: true, // 说明: 是否支持多选文件; 类型: Boolean; 额外判断: 根据limit限制。 data: {}, // 说明: 上传时附带的额外参数; 类型: Object; name: file, // 说明: 上传的文件字段名; 类型: Stirng; 默认: file; withCredentials: false, // 说明: 支持发送 cookie 凭证信息; 类型: Boolean; 默认: false; showFileList: true, // 说明: 是否显示已上传文件列表; 类型: Boolean; 默认: true; drag: false, // 说明: 是否启用拖拽上传; 类型: Boolean; 默认: false; accept: '', // 说明: 接受上传的文件类型(thumbnail-mode 模式下此参数无效); 类型: String; listType: text, // 说明: 文件列表的类型; 类型: String; value: text/picture/picture-card; 默认: text; autoUpload: true, // 说明: 是否在选取文件后立即进行上传; 类型: Boolean; 默认: true; disabled: false, // 说明: 是否禁用; 类型: Boolean; 默认: false; limit: -, // 说明: 最大允许上传个数; 类型: number; 默认: -; } isDirectory: false, // 说明: 是否是文件夹; 是否必填: 必填; 类型: Boolean; 默认为false; exceedMsg: -, // 说明: 超出最大限制提示信息; 类型: String; 默认: '超出最大上传文件个数'; concurrentNumber: 10, // 说明: 超出最大限制提示信息; 类型: Number; 默认: 10;

Methods @changeFiles 说明: 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用;参数: fileList; @on-preview 说明: 点击文件列表中已上传的文件时的钩子; 参数: file; //@on-remove 说明: 文件列表移除文件时的钩; 参数: file, fileList; @on-success 说明: 文件上传成功时的钩子; 参数: response, file, fileList; @on-error 说明: 文件上传失败时的钩子; 参数: err, file, fileList; @on-progress 说明: 文件上传时的钩子; 参数: event, file, fileList; @before-upload 说明: 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传; 参数: file; @before-remove 说明: 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除; 参数: file, fileList; @http-request 说明: 覆盖默认的上传行为,可以自定义上传的实现;

slot trigger 说明: 触发文件选择框的内容 tip 说明: 提示说明文字

refs method clearFiles 说明: 清空已上传的文件列表(该方法不支持在 before-upload 中调用) abort 说明: 取消上传请求 submit 说明: 手动上传文件列表