You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.3 KiB
62 lines
1.3 KiB
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
|
|
Vue.use(Router)
|
|
|
|
/* Layout */
|
|
import Layout from '@/layout'
|
|
/* 所有角色可以访问/没有权限要求的基页 */
|
|
|
|
export const constantRoutes = [
|
|
{
|
|
path: '/',
|
|
redirect: 'index'
|
|
},
|
|
{
|
|
path: '/index',
|
|
component: Layout,
|
|
redirect: '/index',
|
|
children: [{
|
|
path: '/index',
|
|
component: () =>
|
|
import('@/views/index.vue'),
|
|
name: 'index',
|
|
meta: {
|
|
title: '主页',
|
|
noCache: true,
|
|
affix: true
|
|
}
|
|
}]
|
|
},{
|
|
path: '/messagelist',
|
|
component: Layout,
|
|
redirect: '/messagelist',
|
|
children: [{
|
|
path: '/messagelist',
|
|
component: () =>
|
|
import('@/views/anruimessagecenter/messagelist/index.vue'),
|
|
name: 'messagelist',
|
|
meta: {
|
|
title: '消息列表'
|
|
}
|
|
}]
|
|
}
|
|
]
|
|
|
|
// import componentsRouter from '@/router/modules/components'
|
|
|
|
const createRouter = () => new Router({
|
|
// mode: 'history', // require service support
|
|
scrollBehavior: () => ({ y: 0 }),
|
|
routes: constantRoutes
|
|
})
|
|
|
|
const router = createRouter()
|
|
|
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
|
export function resetRouter() {
|
|
const newRouter = createRouter()
|
|
router.matcher = newRouter.matcher // reset router
|
|
}
|
|
|
|
export default router
|
|
|