| | |
| | | import demo_router from './demo_router' |
| | | import system_router from './system_router' |
| | | import op_router from './op_router' |
| | | import agreement_router from './agreement_router' |
| | | |
| | | /** |
| | | * 注:子菜单只出现在路线子时。长度> = 1 |
| | |
| | | |
| | | system_router, |
| | | demo_router, |
| | | agreement_router, |
| | | |
| | | { |
| | | path: 'external-link', |
| | |
| | | |
| | | const router = createRouter() |
| | | |
| | | // 守卫,处理keepAlive周期,用isBack标记是否属于从属页面后退 |
| | | router.beforeEach(function(to, from, next) { |
| | | // 判断是否从从属页面后退 |
| | | if (to.meta.keepAlive && from.meta.activeMenu === to.path) { |
| | | to.meta.isBack = true |
| | | } else { |
| | | to.meta.isBack = false |
| | | } |
| | | next(true) |
| | | }) |
| | | |
| | | // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 |
| | | export function resetRouter() { |
| | | const newRouter = createRouter() |