Show spinner while uploading file
This commit is contained in:
parent
d6cc55ca8c
commit
7d3a6e77e4
2 changed files with 15 additions and 1 deletions
|
@ -11,11 +11,24 @@ const mediaUpload = {
|
|||
const file = target.files[0]
|
||||
const formData = new FormData()
|
||||
formData.append('media', file)
|
||||
|
||||
self.$emit('uploading')
|
||||
self.uploading = true
|
||||
|
||||
statusPosterService.uploadMedia({ store, formData })
|
||||
.then((fileData) => {
|
||||
self.$emit('uploaded', fileData)
|
||||
self.uploading = false
|
||||
}, (error) => {
|
||||
self.$emit('upload-failed')
|
||||
self.uploading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
uploading: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue