dropzone-nuxt

Dropzone.js for Nuxt.js

View the Project on GitHub schlunsen/dropzone-nuxt

dropzone-nuxt

npm (scoped with tag) npm Dependencies

A Dropzone.js module for Nuxt.js.

Installation

$ npm i dropzone-nuxt --save

Setup

{
  modules: [
    // Simple usage
    'dropzone-nuxt',

    // With options
    ['dropzone-nuxt', { /* module options */ }],
 ]
}

Usage

<template>
    <dropzone 
    @vdropzone-file-added="onFileAdded"
    @vdropzone-error="onError"
    @vdropzone-success="onSuccess"
    @vdropzone-complete="onComplete"
    ref="myDropzone" id="dropzone" :options="dropzoneOptions" />
</template>

<script>

export default {
    data() {
        return {
            dropzoneOptions: {
                url: 'https://httpbin.org/post',
                thumbnailWidth: 150,
                maxFilesize: 0.5,
                headers: { "My-Awesome-Header": "header value" }
            }
        }
    },
    methods: {
        onFileAdded(e) {

        },
        onError(e) {

        },
        onSuccess(e) {

        },
        onComplete(e) {

        }


    }
}

</script>