chore(vue-app): pass error as param to nuxt-loading fail method (#6939)

This commit is contained in:
wppd 2020-02-03 23:41:37 +08:00 committed by GitHub
parent 2df3ec4ea3
commit e271aa0a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -178,7 +178,7 @@ export default {
try {
await Promise.all(promises)
} catch (error) {
<% if (loading) { %>this.$loading.fail()<% } %>
<% if (loading) { %>this.$loading.fail(error)<% } %>
globalHandleError(error)
this.error(error)
}
@ -189,7 +189,7 @@ export default {
errorChanged () {
if (this.nuxt.err && this.$loading) {
if (this.$loading.fail) {
this.$loading.fail()
this.$loading.fail(this.nuxt.err)
}
if (this.$loading.finish) {
this.$loading.finish()

View File

@ -88,7 +88,7 @@ export default {
}, 500)
return this
},
fail () {
fail (error) {
this.canSucceed = false
return this
},