mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
refactor: only show NProgress when loading time is too long
This commit is contained in:
parent
723cf1b3b3
commit
f89fc84f95
11 changed files with 33 additions and 35 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue