fix incorrect style when switch pages but some error occurs

This commit is contained in:
MaysWind
2021-03-05 01:27:32 +08:00
parent c74077fb13
commit b0cff71b24
16 changed files with 150 additions and 87 deletions
+18
View File
@@ -299,6 +299,24 @@ Vue.prototype.$showLoading = function (delayConditionFunc, delayMills) {
Vue.prototype.$hideLoading = function () {
return this.$f7.preloader.hide();
};
Vue.prototype.$routeBackOnError = function (errorPropertyName) {
const self = this;
const router = self.$f7router;
const unwatch = self.$watch(errorPropertyName, () => {
if (self[errorPropertyName]) {
setTimeout(() => {
if (unwatch) {
unwatch();
}
router.back();
}, 200);
}
}, {
immediate: true
});
};
Vue.prototype.$user = userstate;