vue-dropzone doesn't generate thumbnails on file add
我想将服务器上已经存在的文件添加到Dropzone,我尝试通过vue-dropzone Docs以及正常的dropzone docs搜索我的问题,我也经历了5+ github问题,并尝试了那里的帮助方法,但是 似乎没有找到解决方法。
所以我叫这个方法:
1 2 3 4 | this.product.images.forEach(image => { const file = { name: 'Icon', type: 'image/jpeg', dataURL: image }; this.$refs.dropzone.manuallyAddFile(file, image); }); |
文件正确添加,但是我根本没有生成任何缩略图。 这基本上就是整个问题。
您可以使用
1 2 3 4 5 6 | 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) }); |
如果您的参考文献是
并且您需要在
祝好运!