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

icms-dropzone

v2.0.2

Published

A wrapper around Dropzone.js for Vue 2

Downloads

4

Readme

vue-dropzone

A Vue component for file uploads, powered by Dropzone.js. Check out the demo.

Install

// For Vue.js 2.0+
npm install vue-dropzone^2.0.0

// For Vue.js 1.0+
npm install [email protected]

Usage

  1. Import the module
  2. Register it as a component as you would any other Vue component
  3. Use it within your template

Example

<template>
  <div id="app">
    <p>Welcome to your Vue.js app!</p>

    <dropzone id="myVueDropzone" url="https://httpbin.org/post" v-on:vdropzone-success="showSuccess"></dropzone>

  </div>
</template>

<script>
  import Dropzone from 'vue-dropzone/lib/Dropzone'

  export default {
    name: 'MainApp',
    components: {
      Dropzone
    },
    methods: {
      'showSuccess': function (file) {
        console.log('A file was successfully uploaded')
      }
    }
  }
</script>

Props

Many of these props are inherited from dropzone configuration so see their doco for further details.

| Prop Name | Type | Description | |----------|------|--------------| | id | String | A string by which to identify the component, can be anything. Required| | url | String | Url to post the upload to. Required| | clickable | Boolean | Whether the dropzone area is clickable, if false then users can only drag items on to the area.| | acceptedFileTypes | String | A comma separated string of accepted file types eg 'image/*,application/pdf,.psd' .| | thumbnailHeight | Number | The height of thumbnails in pixels.| | thumbnailWidth | Number | The width of thumbnails in pixels.| | showRemoveLink | Boolean | Whether the Remove link is shown on items.| | maxFileSizeInMB | Number |The maximum file size for a single upload in MB.| | maxNumberOfFiles | Number | The maximum number of files to allow the user to upload.| | autoProcessQueue | Boolean | Whether the files are automatically uploaded or not.| | useCustomDropzoneOptions | Boolean | If you want to define your own Dropzone config set this to true and define a dropzoneOptions.| | dropzoneOptions | Object | A custom set of rules to define your dropzone object, use anything available in the dropzone config.|

Events

Events to send to the component.

| Event Name | Description | |------------|-------------| | removeAllFiles() | Empties the dropzone area.| | processQueue() | Uploads the files, required if autoProcessQueue is set to false.|

Events emitted by the component to the parent.

| Event Name | Description | |------------|-------------| | vdropzone-fileAdded(file) | File added to the dropzone.| | vdropzone-success(file, response) | File successfully uploaded.| | vdropzone-error(file) | File uploaded encountered an error.| | vdropzone-removedFile(file, error, xhr) | A file was removed from the dropzone.|

Development

# install dependencies
npm install

# serve example at localhost:8080
npm run dev

# build any changes made
npm run build