code refactor

This commit is contained in:
MaysWind
2020-11-02 22:06:18 +08:00
parent ebd2421d57
commit 2440369310
7 changed files with 103 additions and 95 deletions
+14
View File
@@ -99,6 +99,20 @@ Vue.prototype.$toast = function (message, timeout) {
closeTimeout: timeout || 1500
}).open();
};
Vue.prototype.$showLoading = function (delayConditionFunc, delayMills) {
if (!delayConditionFunc) {
return this.$f7.preloader.show();
}
setTimeout(() => {
if (delayConditionFunc()) {
this.$f7.preloader.show();
}
}, delayMills || 200);
};
Vue.prototype.$hideLoading = function () {
return this.$f7.preloader.hide();
};
Vue.prototype.$services = services;
Vue.prototype.$user = userstate;