router.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import Vue from 'vue';
  2. import Router from 'vue-router';
  3. import tab from 'components/tab';
  4. import Login from '@/pages/login/Login';
  5. import Layout from '@/pages/layout/Layout';
  6. Vue.use(Router)
  7. export default new Router({
  8. // mode: 'history',
  9. // base: process.env.BASE_URL,
  10. routes: [
  11. {
  12. path: '/login',
  13. name:'login',
  14. component: Login,
  15. },
  16. {
  17. path: '/',
  18. name:'layout',
  19. component: Layout,
  20. redirect: '/login',
  21. hidden: true
  22. },
  23. {
  24. path: '/channel',
  25. component: Layout,
  26. children: [{
  27. path: 'index',
  28. name:'Channel',
  29. meta: { title: '渠道管理', url: '/channel/index' },
  30. component: () => import('@/pages/channel/Channel'),
  31. }]
  32. },
  33. {
  34. path: '/course',
  35. component: Layout,
  36. children: [{
  37. path: 'index',
  38. name:'Course',
  39. meta: { title: '课程管理', url: '/course/index' },
  40. component: () => import('@/pages/course/Course'),
  41. }]
  42. },
  43. {
  44. path: '/relation',
  45. component: Layout,
  46. children: [{
  47. path: 'index',
  48. name:'Relation',
  49. meta: { title: '课程管理', url: '/relation/index' },
  50. component: () => import('@/pages/relation/Relation'),
  51. }]
  52. },
  53. {
  54. path: '/nav',
  55. component: Layout,
  56. children: [{
  57. path: 'nav1',
  58. name:'Nav1',
  59. meta: { title: 'nav1', url: '/nav/nav1' },
  60. component: () => import('@/pages/nav1/Nav1'),
  61. },{
  62. path: 'nav2',
  63. name:'Nav2',
  64. meta: { title: 'nav2', url: '/nav/nav2' },
  65. component: () => import('@/pages/nav2/Nav2'),
  66. }]
  67. }
  68. ]
  69. })