parent
9dab91e37e
commit
555bc5a4b2
@ -1,10 +1,28 @@ |
|||||||
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' |
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' |
||||||
|
import NProgress from 'nprogress' // progress bar
|
||||||
|
import 'nprogress/css/nprogress.css' // 进度条样式
|
||||||
|
|
||||||
const routes: Array<RouteRecordRaw> = [] |
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||||
|
|
||||||
|
const routes: Array<RouteRecordRaw> = [ |
||||||
|
{ |
||||||
|
path: '/:pathMatch(.*)*', |
||||||
|
component: () => import('@/visual-editor/index.vue') |
||||||
|
} |
||||||
|
] |
||||||
|
|
||||||
const router = createRouter({ |
const router = createRouter({ |
||||||
history: createWebHashHistory(), |
history: createWebHashHistory(), |
||||||
routes |
routes |
||||||
}) |
}) |
||||||
|
|
||||||
|
router.beforeEach(() => { |
||||||
|
NProgress.start() // start progress bar
|
||||||
|
return true |
||||||
|
}) |
||||||
|
|
||||||
|
router.afterEach(() => { |
||||||
|
NProgress.done() // finish progress bar
|
||||||
|
}) |
||||||
|
|
||||||
export default router |
export default router |
||||||
|
Loading…
Reference in new issue