perf: 客户端隐藏顶部加载进度条

This commit is contained in:
kuaifan 2022-04-12 11:53:33 +08:00
parent 9ffa46a878
commit ad46fd1aae

View File

@ -66,17 +66,19 @@ const router = new VueRouter({
}); });
// 进度条配置 // 进度条配置
ViewUI.LoadingBar.config({ if (!isElectron) {
ViewUI.LoadingBar.config({
color: '#3fcc25', color: '#3fcc25',
failedColor: '#ff0000' failedColor: '#ff0000'
}); });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
ViewUI.LoadingBar.start(); ViewUI.LoadingBar.start();
next(); next();
}); });
router.afterEach(() => { router.afterEach(() => {
ViewUI.LoadingBar.finish(); ViewUI.LoadingBar.finish();
}); });
}
// 加载函数 // 加载函数
Vue.prototype.goForward = function(location, isReplace) { Vue.prototype.goForward = function(location, isReplace) {