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

zui-upload

v1.0.7

Published

A Vue.js project

Readme

zui-upload

A Vue.js project

分为七牛云上传跟图片压缩两种,解决了手机拍照上传旋转跟压缩等问题
第一种使用方式:七牛云上传,包含图片压缩功能,七牛云上传时需要配置 qiniuOptions 配置项,直接上传七牛云,上传完毕返回上传图片的信息
第二种使用方式:图片压缩,只有压缩图片的功能,压缩成功后返回图片文件信息,根据返回的文件信息自己上传服务端
** tips: 支持slot自定义内容 **

安装

npm install zui-upload -S

全局使用

import ZuiUpload from "zui-upload";
Vue.use(ZuiUpload);

组件内使用

import ZuiUpload from "zui-upload";
components:{
  ZuiUpload
}

Example

<template>
  <div>
    <!-- 使用七牛云压缩图片并上传 -->
    <zui-upload
      :qiniu-options="qiniuOptions"
      :img-options="imgOptions"
      @next="next"
      @complete="complete"
      @error="error"
    ></zui-upload>
    <!-- 不上传,只压缩图片 -->
    <zui-upload :img-options="imgOptions" @complete="complete">
      <!-- 使用 slot 自定义内容 -->
      <p>我是自定义的内容</p>
    </zui-upload>
    <img id="previewImg" src alt>
  </div>
</template>
<script>
export default {
  data() {
    return {
      imgOptions: {
        width: 600,
        height: 600,
        quality: 0.8
      },
      qiniuOptions: {
        token: "你的七牛云token",
        // 七牛云路劲以 / 结尾,错误:http://yourpath.cn   正确:http://yourpath.cn/
        baseUrl: "你的七牛云路径"
      }
    };
  },
  methods: {
    next(res) {
      console.log(res);
      console.log("七牛云上传时:进度");
    },
    error(err) {
      console.log(err);
      console.log("七牛云上传错误时:错误信息");
    },
    complete(res) {
      console.log(res);
      console.log("上传完成");
      document.getElementById("previewImg").src = res.url;
    }
  }
};
</script>

Options

| 配置项 | 属性 | 描述 | 类型 | 默认值 | | ----------------- | ----------------- | ---------------- | :--------: | :----------: | | imgOptions | | 图片的配置 | | | | width | 宽度 |Number | - | | | height | 高度 |Number | - | | | quality | 质量 |Number | 0.9 | | qiniuOptions | | 七牛云配置(不使用七牛云上传无需配置) | | || token | 七牛云token |String | - | || baseUrl | 七牛云路径 |String | - |

Functions

| 函数 | 描述 | 参数 | | :--------: | ----- | ----- | | complete | 文件上传(压缩)成功后触发 | 文件对象 | | next | 文件上传中触发(七牛云上传时有效) | 上传进度 | | error | 文件上传失败后触发(七牛云上传时有效) | 失败原因 |

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

For detailed explanation on how things work, consult the docs for vue-loader.