I want to access the VueJS variable from the success callback of the Dropzone success event. All code is fine, DropzoneJS and VueJS work fine together, but my photos variable is not available in the success callback.
Here is a simple implementation of my script:
<script> import Dropzone from 'dropzone'; export default { data() { return { photos: [] }; }, ready() { Dropzone.autoDiscover = false; new Dropzone('form#upload-form', { url: '...', success: function(file, response) { this.photos = response.data.photos; </script>
Is there a best practice for accessing VueJS component variables this way? Thanks
source share