refactor: only show NProgress when loading time is too long

This commit is contained in:
qier222 2021-06-08 16:37:05 +08:00
parent 723cf1b3b3
commit f89fc84f95
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
11 changed files with 33 additions and 35 deletions

View file

@ -1,11 +1,7 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import NProgress from 'nprogress';
import '@/assets/css/nprogress.css';
import { isLooseLoggedIn, isAccountLoggedIn } from '@/utils/auth';
NProgress.configure({ showSpinner: false, trickleSpeed: 100 });
Vue.use(VueRouter);
const routes = [
{
@ -169,13 +165,4 @@ router.beforeEach((to, from, next) => {
}
});
router.afterEach(to => {
if (
to.matched.some(record => !record.meta.keepAlive) &&
!['settings', 'dailySongs', 'lastfmCallback'].includes(to.name)
) {
NProgress.start();
}
});
export default router;