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

aq-el-upload

v1.0.2

Published

基于vue3+vite+element-plus+el-upload封装的上传组件

Readme

基于 vue3+vite+element-plus+el-upload 封装的上传组件

介绍

基于 Vue3、Vite、Element Plus 及 El-Upload 打造的高效上传组件,适用于现代 Web 应用,提供简便快捷的文件上传体验。

安装教程

  1. npm install

使用说明

  1. 暴露的方法为 fileChange
  2. 传递的参数如下
const props = defineProps({
  uploadType: {
    //上传类型:button-按钮型,box-框型
    type: String,
    default: "button",
  },
  fileList: {
    //默认文件列表
    type: Array,
    default: () => [
      {
        url: "",
        name: "文件名称",
      },
    ],
  },
  limit: {
    //上传数量限制
    type: Number,
    default: 1,
  },
  multiple: {
    //是否多选
    type: Boolean,
    default: false,
  },
  uploadAction: {
    //上传地址
    type: String,
    default: "",
  },
  acceptList: {
    //文件类型限制
    type: Array,
    default: () => [".jpg", ".png"], //文件类型数组 ['.jpg', '.png'],注意:上传类型为box模式下只能配置上传图片的格式,其它比如.rar不生效
  },
  buttonName: {
    //上传按钮的名字
    type: String,
    default: "图片",
  },
  fileSize: {
    //单个上传文件的大小MB
    type: Number,
    default: 30,
  },
  token: {
    //token
    type: String,
    default: "",
  },
});
<template>
  <div class="card-box">
    <h5>按钮上传</h5>
    <div class="upload-main">
      <AqElUpload @fileChange="getFileData" :fileList="fileList" :multiple="true" :limit="1"
        :acceptList="['.jpg', '.png', '.pdf', '.word', '.excel']" :fileSize="10" uploadAction="/api/web/duty/upload"
        buttonName="文件" :token="token" />
    </div>
    <h5>框上传</h5>
    <div class="upload-main">
      <AqElUpload @fileChange="getFileData" :fileList="fileList" :multiple="true" :limit="5"
        :acceptList="['.jpg', '.png']" :fileSize="20" uploadAction="/api/web/risks/upload" uploadType="box"
        :token="token" />
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import AqElUpload from 'aq-el-upload';
import storage from '@/utils/storage.js';

const token = storage.sessionStorage.get('token');

const fileList = ref([]);
const getFileData = (val) => {
  console.log("接收的图片地址", val);
};
</script>

<style lang="scss" scoped>
h5 {
  margin: 40px 0 20px;
}
</style>

参与贡献

  1. 2025-03-12
  2. 阿秋(杰尼斯邦邦)