Reputation: 3674
I wanna add files that are already on my Server to the Dropzone, I tried to search my problem over vue-dropzone Docs as well as the normal dropzone docs and I also went through like 5+ github issues and tried the help approaches there but I did not seem to find the solution.
So I call this method:
this.product.images.forEach(image => {
const file = { name: 'Icon', type: 'image/jpeg', dataURL: image };
this.$refs.dropzone.manuallyAddFile(file, image);
});
The files get added correctly but I simply get no Thumbnail generated at all. Thats basicly the whole problem.
Upvotes: 0
Views: 2222
Reputation: 3869
You can manually add thumbnail with emit
:
this.product.images.forEach(image => {
const file = { name: 'Icon', type: 'image/jpeg', dataURL: image };
this.$refs.dropzone.manuallyAddFile(file, image);
this.$refs.dropzone.dropzone.emit('thumbnail', file, file.dataURL)
this.$refs.dropzone.dropzone.emit('complete', file)
});
If your ref is dropzone
you need to go to this.$refs.dropzone.dropzone
.
And you need to call your method in @vdropzone-mounted="loadPictures"
.
Good luck!
Upvotes: 5