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

iview-upload

v1.0.1

Published

基于iview的文件上传组件

Downloads

1

Readme

iview-upload

基于 iview 进行二次开发的图片上传组件,支持上传后本地图片回显、私密图片回显不显示具体图片、上传前压缩、集成 viewjs 全屏预览插件(注:使用前先引入 iview,否则无法使用)

安装

npm install iview-upload --save

引入

import uploadCustom from "iview-upload";

在引入的 vue 模块中需要在 components 上注册这个组件,这样才可以正常使用这个组件:

export default {
  name: 'app',
  components:{
    uploadCustom
  },
  data () {
     return {
        ...
     }
  },
  ...
}

效果

多选效果

调用方式

<upload-custom v-model="val"></upload-custom>

参数说明

| 属性 | 说明 | 类型 | 默认 | 版本 | | :---------------------- | ----------------------------------------------------- | :-----: | :-------------: | :---: | | action 上传的地址,必填 | | String | 空 | 1.0.0 | | headers | 设置上传的请求头部 | Object | - | 1.0.0 | | fileData | 初始图片数据 | String | 空 | 1.0.0 | | params | 上传时附带的额外参数 | Object | - | 1.0.0 | | readonly | 是否只读 | Object | false | 1.0.0 | | noShow | 隐私图片不展示具体 | Object | false | 1.0.0 | | maxSize | 文件大小限制,单位 byte | Number | 2 _ 1024 _ 1024 | 1.0.0 | | format | 支持的文件类型,识别文件的后缀名 | Array | [] | | autoCompress | 支持上传前自动压缩 | Boolean | false | | maxWidth | 图片最大宽度,超过则压缩,autoCompress 为 true 时生效 | Number | 2000 | | maxHeight | 图片最大高度,超过则压缩,autoCompress 为 true 时生效 | Number | 2000 |

方法说明

| 方法 | 说明 | 返回值 | | :---------- | -------------- | :------------: | | on-success | 上传成功 | response, file | | on-remove | 文件移除 | | | on-progress | 文件上传时返回 | file |