0.1.3 • Published 4 years ago

dropzone-nuxt v0.1.3

Weekly downloads
66
License
MIT
Repository
github
Last release
4 years ago

dropzone-nuxt

npm (scoped with tag) npm Dependencies

A Dropzone.js module for Nuxt.js.

Installation

$ npm i dropzone-nuxt --save

Setup

  • Add dropzone-nuxt dependency using yarn or npm to your project
  • Add dropzone-nuxt to modules section of nuxt.config.js
{
  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>