pull/235/head
Ryan Wang 2020-08-23 22:37:58 +08:00 committed by GitHub
parent 1adb0a6dcb
commit 10626d04c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -80,19 +80,19 @@ export default {
computed: {
...mapGetters(['options']),
maxParallelUploads() {
if (this.options && this.options.length > 0) {
if (this.options) {
return this.options.attachment_upload_max_parallel_uploads
}
return 1
},
allowImagePreview() {
if (this.options && this.options.length > 0) {
if (this.options) {
return this.options.attachment_upload_image_preview_enable
}
return false
},
maxFiles() {
if (this.options && this.options.length > 0) {
if (this.options) {
return this.options.attachment_upload_max_files
}
return 1
@ -110,7 +110,7 @@ export default {
this.uploadHandler(
formData,
progressEvent => {
(progressEvent) => {
if (progressEvent.total > 0) {
progress(progressEvent.lengthComputable, progressEvent.loaded, progressEvent.total)
}
@ -119,12 +119,12 @@ export default {
this.filed,
file
)
.then(response => {
.then((response) => {
load(response)
this.$log.debug('Uploaded successfully', response)
this.$emit('success', response, file)
})
.catch(failure => {
.catch((failure) => {
this.$log.debug('Failed to upload file', failure)
this.$emit('failure', failure, file)
error()