mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix large file sizes bug
This commit is contained in:
parent
3c580c9296
commit
154b6a6f78
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user