123456789101112131415161718192021 |
- import router from "@/router";
- // 进度条
- import NProgress from "nprogress";
- // 进度条样式
- import "nprogress/nprogress.css";
- NProgress.configure({ showSpinner: false });
- // 注册路由跳转的权限控制
- router.beforeEach(async (to, from, next) => {
- let title = "";
- const isCorrect = document.title.includes("test");
- title = isCorrect ? document.title : "京铁学堂";
- document.title = title;
- NProgress.start();
- next();
- });
- router.afterEach(() => {
- NProgress.done();
- });
|