|
@@ -3,6 +3,9 @@ import VueRouter from 'vue-router'
|
|
|
import Store from '../store'
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
|
+import NProgress from 'nprogress' // Progress 进度条
|
|
|
+import 'nprogress/nprogress.css'// Progress 进度条样式
|
|
|
+
|
|
|
import {stringifyQuery,parseQuery} from '@/utils/query'
|
|
|
|
|
|
Vue.use(VueRouter)
|
|
@@ -287,6 +290,7 @@ const router = new VueRouter({
|
|
|
})
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
+ NProgress.start()
|
|
|
if (to.meta.title) {
|
|
|
document.title = to.meta.title;
|
|
|
}
|
|
@@ -339,6 +343,7 @@ function routeExists(array, path, parentPath) {
|
|
|
|
|
|
// 在你的路由配置文件中
|
|
|
router.afterEach((to, from) => {
|
|
|
+ NProgress.done()
|
|
|
var sign = routeExists(backStageManageRouterItem, to.path)
|
|
|
if (!sign) {
|
|
|
return
|