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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vsuperfiles

v0.0.2

Published

三合一解决文件上传

Downloads

4

Readme

vSuperFiles

关键词

  • Vue 指令
  • 多文价夹
  • 多文件
  • 文件上传
  • 拖拽上传

介绍

解决多文件夹拖拽,多文件上传问题。

安装

npm install vsuperfiles -S 

使用

main.js

import Vue from 'vue';
import App from './App.vue';
import vSuperFiles from 'vsuperfiles';

Vue.config.productionTip = false;

Vue.use(vSuperFiles({
    name: 'files' // 如果有必要,自定义指令名
}));

new Vue({
    render: (h) => h(App),
}).$mount('#app');

App.vue

参数说明

  1. VueUse 时:
    1. name: 自定义指令名字;即使用 v-files 时为 v-[name]
Vue.use(vSuperFiles({
    name: 'files' // 如果有必要,自定义指令名
}));

<template>
  <div
      v-files.drag.webkitdirectory.multiple="{
        paths: [],
        files: [],
        accept: [],
    }"
      @files-change="handleFiles"
      @drag-error="error"
  ></div>
</template>
<script>
export default {
  methods: {
    handleFiles() {
    },
    error(e) {
    }
  }
}
</script>
  1. 使用指令时:
    1. 修饰符
      1. drag:是否支持拖拽放入文件夹或文件,支持文件夹和多个文件传入。
      2. webkitdirectory: 点击时进入文件夹模式,默认进入文件选择模式。
      3. multiple: 开启多选模式,不设置时不可多选。
      4. accept: 支持的 MIME-TYPE
        1. 详情请见:MDN
      5. customize: 回调函数,创建 input 时如果需要自定义,自行设置。
    2. 绑定值
      1. paths: 传入需要绑定的 paths,不传入时不绑定。
      2. files: 传入需要绑定的 files,不传入时不绑定。
      3. accept: inputaccept限定,不传时都允许。
    3. 事件
      1. @files-change: 用户传入文件时
        1. 回调第一个参数为 files,第二个为 paths。
        2. 分别为当前传入的文件和路径。
      2. @drag-error
        1. 拖拽时读取失败时回调。

待完成内容

  • 类型声明
  • 测试覆盖