I need to render vue-dropzone response to my users. How do i do that?
The file uploads well, i only need to show to notify the user it is uploaded via an alert box or message.
<template>
<div class="container">
<div class="eight wide field">
<vue-dropzone ref="myVueDropzone" id="dropzone" :options="dropzoneOptions" vdropzone-success=""></vue-dropzone>
</div>
</div>
</template>
<script>
import vue2Dropzone from 'vue2-dropzone';
import 'vue2-dropzone/dist/vue2Dropzone.min.css';
export default {
name: 'app',
components: {
vueDropzone: vue2Dropzone
},
data: function () {
return {
dropzoneOptions: {
url: '/formsubmit',
thumbnailWidth: 150,
maxFilesize: 0.5,
addRemoveLinks: true,
removeFile:true,
headers: { "X-CSRF-TOKEN": document.head.querySelector("[name=csrf-token]").content }
}
}
}
};
</script>
You can add a listener handler to listen the
vdropzone-success
event ofvue-dropzone
component.This code should be working.
Hope this helps to you.