rowanwins / vue-dropzone

A Vue.js component for Dropzone.js - a drag’n’drop file uploads utility with image previews
https://rowanwins.github.io/vue-dropzone/docs/dist
MIT License
2.02k stars 1.4k forks source link

Access parameters of Events. #535

Closed yabuking84 closed 4 years ago

yabuking84 commented 4 years ago

How do we access the parameters of events? Ex. vdropzone-removed-file(file, error, xhr)

In my component:

<vue2-dropzone  @vdropzone-removed-file="vdz_removed"/>

In my script (methods):

vdz_removed(file, error, xhr) {
    console.log('vdz_removed file = ', file);
    console.log('vdz_removed error = ', error);
    console.log('vdz_removed xhr = ', xhr);
}

Is this correct? Also if I want to add a custom parameter how do still access the default parameters?

like: <vue2-dropzone @vdropzone-removed-file="vdz_removed(ile, error, xhr, custom_arg)"/>

rowanwins commented 4 years ago

Unfortunately the @vdropzone-removed-file event only receives the file as an argument, error and xhr are not available - this is a limitation of the base dropzone library. You're also not able to pass through custom arguments.

Sorry I can't help more with that one