| | |
| | | import Vue from 'vue' |
| | | import Router from 'vue-router' |
| | | |
| | | |
| | | Vue.use(Router) |
| | | |
| | | |
| | | /* Layout */ |
| | | import Layout from '@/layout' |
| | | |
| | | |
| | | /** |
| | | * Note: 路由配置项 |
| | | * |
| | |
| | | activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 |
| | | } |
| | | */ |
| | | |
| | | |
| | | // 公共路由 |
| | | export const constantRoutes = [ |
| | | { |
| | |
| | | name: 'Index', |
| | | meta: { title: '首页', icon: 'dashboard', affix: true } |
| | | } |
| | | |
| | | |
| | | ] |
| | | }, |
| | | { |
| | |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | |
| | | // 动态路由,基于用户权限动态去加载 |
| | | export const dynamicRoutes = [ |
| | | { |
| | |
| | | path: '/family/note1', |
| | | component: Layout, |
| | | permissions: ['family:note:list'], |
| | | |
| | | |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'propertyInfo/:id(\\d+)', |
| | | component: () => import('@/views/note/propertyInfo'), |
| | | name: 'propertyInfo', |
| | | meta: { title: '查询详情'} |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | //个人 |
| | | |
| | | { |
| | | path: '/self/self1', |
| | | component: Layout, |
| | | permissions: ['self:self:list'], |
| | | |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'propertyInfo/:id(\\d+)', |
| | | component: () => import('@/views/note/propertyInfo'), |
| | | name: 'propertyInfo', |
| | | meta: { title: '查询详情'} |
| | | } |
| | | ] |
| | | }, |
| | | //家大事记的详情 |
| | | { |
| | | path: '/family1/bignote', |
| | | component: Layout, |
| | | // permissions: [], |
| | | permissions: ['family1:bignote:list'], |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'familyeventInfo/:id(\\d+)', |
| | | component: () => import('@/views/bignote/familyeventInfo'), |
| | | name: 'familyeventInfo', |
| | | meta: { title: '查询详情'} |
| | | } |
| | | ] |
| | |
| | | ] |
| | | } |
| | | ] |
| | | |
| | | |
| | | // 防止连续点击多次路由报错 |
| | | let routerPush = Router.prototype.push; |
| | | Router.prototype.push = function push(location) { |
| | | return routerPush.call(this, location).catch(err => err) |
| | | } |
| | | |
| | | |
| | | export default new Router({ |
| | | mode: 'history', // 去掉url中的# |
| | | scrollBehavior: () => ({ y: 0 }), |
| | | routes: constantRoutes |
| | | }) |
| | | }) |