mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
fix incorrect style when switch pages but some error occurs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<f7-page>
|
||||
<f7-page @page:afterin="onPageAfterIn">
|
||||
<f7-navbar>
|
||||
<f7-nav-left :back-link="$t('Back')"></f7-nav-left>
|
||||
<f7-nav-title :title="$t(title)"></f7-nav-title>
|
||||
@@ -320,6 +320,7 @@ export default {
|
||||
return {
|
||||
editAccountId: null,
|
||||
loading: false,
|
||||
loadingError: null,
|
||||
account: {
|
||||
category: 1,
|
||||
type: self.$constants.account.allAccountTypes.SingleAccount,
|
||||
@@ -384,7 +385,6 @@ export default {
|
||||
created() {
|
||||
const self = this;
|
||||
const query = self.$f7route.query;
|
||||
const router = self.$f7router;
|
||||
|
||||
if (query.id) {
|
||||
self.loading = true;
|
||||
@@ -430,11 +430,11 @@ export default {
|
||||
|
||||
self.loading = false;
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
|
||||
if (!error.processed) {
|
||||
if (error.processed) {
|
||||
self.loading = false;
|
||||
} else {
|
||||
self.loadingError = error;
|
||||
self.$toast(error.message || error);
|
||||
router.back();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -445,6 +445,9 @@ export default {
|
||||
this.autoChangeCommentTextareaSize();
|
||||
},
|
||||
methods: {
|
||||
onPageAfterIn() {
|
||||
this.$routeBackOnError('loadingError');
|
||||
},
|
||||
addSubAccount() {
|
||||
const self = this;
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
loadingError: null,
|
||||
showHidden: false,
|
||||
sortable: false,
|
||||
accountToDelete: null,
|
||||
@@ -330,7 +331,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
const self = this;
|
||||
const router = self.$f7router;
|
||||
|
||||
self.loading = true;
|
||||
|
||||
@@ -339,11 +339,11 @@ export default {
|
||||
}).then(() => {
|
||||
self.loading = false;
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
|
||||
if (!error.processed) {
|
||||
if (error.processed) {
|
||||
self.loading = false;
|
||||
} else {
|
||||
self.loadingError = error;
|
||||
self.$toast(error.message || error);
|
||||
router.back();
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -352,6 +352,8 @@ export default {
|
||||
if (this.$store.state.accountListStateInvalid && !this.loading) {
|
||||
this.reload(null);
|
||||
}
|
||||
|
||||
this.$routeBackOnError('loadingError');
|
||||
},
|
||||
reload(done) {
|
||||
if (this.sortable) {
|
||||
|
||||
Reference in New Issue
Block a user