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

vue-easy-multi-file-upload

v1.3.8

Published

๐Ÿ—„๏ธ File upload component for Vue 2

Downloads

9

Readme

vue-easy-multi-file-uploader

File uploading made easy for vueJs. Custom validators, custom styling, file preview support for image & videos...

Please use the latest version.

Snapshot!

How to use

1. Install package via npm

npm i vue-easy-multi-file-upload --save

2. Import & use

<template>
  <div id="app">
    <VueEasyMultiFileUpload :config="config" v-model="values" />
    {{values}}
  </div>
</template>

<script>
import VueEasyMultiFileUpload from "vue-easy-multi-file-upload";

export default {
  components: { VueEasyMultiFileUpload },
  data() {
    return {
      config: {
        id: "multi-file-uploader",
        label: "Upload your files",
        maxFiles: 6,
        uploadUrl: "...",
        deleteUrl: "...",
        uploadHttpMethod: "POST",
        deleteHttpMethod: "DELETE",
        uploadFieldName: "file",
        deleteFieldName: "filePath",
        Authorization: "Bearer ...",
        style: {
          width: "90px",
          height: "75px",
        },
        allowExt: ["jpg", "png", "gif", "mp4", "txt", "webm", "pdf"],
        maxSize: 5,
        delimiter: "|",
        customValidator: (file) => {
          // ... custom validation logic ...
          return {
            status: true, // or false
            message: "It passes validation" // or null
          }
          // Tip: function can be async, can also return promise
        }
      },
      values: null
    };
  },
};
</script>

Props

There is only one prop i.e. config. Fields marked with asterisk(*) are required.

| Name | Description | Default Value | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | | *uploadUrl* | URL to upload file. Specified request is sent as FormData. | | | uploadHttpMethod* | HTTP method for uploadUrl. Generally it's either POST or PUT. | POST | | uploadFieldName* | Name of key for FormData that holds file. | file | | deleteUrl | URL to delete file. Specified request is sent to this url with application/json ContentType & uploaded file's path. | | | deleteHttpMethod | HTTP method for deleteUrl. Generally its DELETE, can also be POST or PUT. | DELETE | | deleteFieldName | fieldName containing file path to delete. | filePath | | | Authorization | Authorization header. eg: Beaker token | | | allowExt* | File extensions to allow. Used for validating file before upload. | ["jpg", "png", "gif", "mp4", "txt", "pdf"] | | maxSize | Max size of file in Mb. | | | maxFiles | Maximum number of files to upload | | | label | Text to show at initial state. Also supports HTML. | Upload a file | | uploadingMessage | Text to show at uploading state. Also supports HTML. | Loading... | | style | Custom style for file upload section. Accepts style in plain string or object | | | delimiter | If delimiter is specified, a single string containing file paths seperated by delimeter is returned. eg: pipes, comma | | | id | Id of parent element | multi-file-uploader | | customValidator | Custom validation for uploaded file before sending it to server. View example above. | | compress | Compress images. Uses compressorjs | false | |compressorOptions | Compressorjs options. View compressorjs for more details | null

Events

| Name | Description | | ------ | ----------------------------------------------------------- | | @input | Fired when new file is uploaded or existing file is deleted |