Fix large file sizes bug

This commit is contained in:
aonomike 2019-05-28 23:31:57 +03:00
parent 3c580c9296
commit 154b6a6f78

View File

@ -9,6 +9,7 @@
:style="backgroundImage"
@vdropzone-thumbnail="thumbnail"
@vdropzone-drop="vddrop"
@vdropzone-error="verror"
/>
</div>
</template>
@ -27,10 +28,11 @@ export default {
return {
dropzoneOptions: {
url: this.vddrop,
maxFilesize: 0.5,
maxFilesize: 3.0,
previewTemplate: this.template(),
dictDefaultMessage: '',
},
error: false,
}
},
computed: {
@ -42,19 +44,20 @@ export default {
}
},
},
watch: {
error() {
let that = this
setTimeout(function() {
that.error = false
}, 2000)
},
},
methods: {
template() {
return `<div class="dz-preview dz-file-preview">
<div class="dz-image">
<div data-dz-thumbnail-bg></div>
</div>
<div class="dz-details">
<div class="dz-size"><span data-dz-size></span></div>
<div class="dz-filename"><span data-dz-name></span></div>
</div>
<div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
<div class="dz-error-message"><span data-dz-errormessage></span></div>
</div>
</div>
`
},
@ -94,6 +97,12 @@ export default {
})
.catch(error => this.$toast.error(error.message))
},
verror(file, message) {
this.error = true
if (file.status === 'error') {
this.$toast.error(file.status, message)
}
},
},
}
</script>