Delay loading animation (#8)

This commit is contained in:
konrad 2018-11-27 10:23:50 +00:00 committed by Gitea
parent 12f58bc1c6
commit 74455b058a
15 changed files with 112 additions and 58 deletions

View file

@ -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)
},
}