Delay loading animation (#8)
This commit is contained in:
parent
12f58bc1c6
commit
74455b058a
15 changed files with 112 additions and 58 deletions
|
|
@ -40,19 +40,18 @@
|
|||
},
|
||||
methods: {
|
||||
loadTeams() {
|
||||
this.loading = true
|
||||
const cancel = message.setLoading(this)
|
||||
|
||||
HTTP.get(`teams`, {headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')}})
|
||||
.then(response => {
|
||||
this.$set(this, 'teams', response.data)
|
||||
this.loading = false
|
||||
cancel()
|
||||
})
|
||||
.catch(e => {
|
||||
this.handleError(e)
|
||||
})
|
||||
},
|
||||
handleError(e) {
|
||||
this.loading = false
|
||||
message.error(e, this)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue