我已经将DropzoneJ集成到一个VueJs应用程序中。它在Chrome和Firefox中运行良好,但出于某种原因,应用程序在Safari中非常难过。我在Safari中收到以下错误:尝试重新定义属性' filesizeBase'。
我的Vue组件看起来如下:
var Dropzone = require('../../vendor/dropzone.min.js');
module.exports = {
template: require('./views/files.html'),
props: ['files', 'is-complete'],
data: function()
{
return {
reverse: -1,
uploading: false,
token: document.querySelector('#token').getAttribute('value'),
project: document.querySelector('#project').getAttribute('value'),
}
},
methods: {
uploadFile: function(e)
{
e.preventDefault();
var self = this;
this.uploading = !this.uploading;
if(this.uploading)
{
var myDropzone = new Dropzone("form#mediaUpload", {
init: function() {
this.on("complete", function(file) {
setTimeout(function()
{
self.uploading = false;
}, 5000);
});
this.on("success", function(file, uploadedFile) {
self.files.push(uploadedFile);
});
},
paramName: "file",
maxFilesize: 250, // MB
maxFiles: 15,
uploadMultiple: false,
});
}
},
deleteFile: function(file, index)
{
this.files.pop(index);
this.$nextTick(function()
{
this.$http.post('/upload/'+file.id+'/delete');
});
},
},
components: {
fileSize: require('./FileSize'),
humanTime: require('../Helpers/HumanTime'),
mimeType: require('../Helpers/MimeType'),
}
}