zhanghua
11 小时以前 4049531e168e3abd88c1c7809c4350424622cd8e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import router from '@/router'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import config from '@/config/config'
 
 
NProgress.configure({
  showSpinner: false,
})
 
const WEBSITE_NAME = config.WEBSITE_NAME
 
 
router.beforeEach((to, from, next) => {
  document.title = to.meta.title
    ? `${WEBSITE_NAME} | ${to.meta.title}`
    : WEBSITE_NAME
 
 
  NProgress.start()
  next()
})
 
router.afterEach(() => {
  NProgress.done()
})