index.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import HomeView from '../views/HomeView.vue'
  4. import PointsRank from '../views/PointsRank.vue'
  5. Vue.use(VueRouter)
  6. const routes = [
  7. {
  8. path:'/',
  9. redirect:'/home',
  10. },
  11. {
  12. path: '/home',
  13. component: HomeView,
  14. redirect:'/home/index',
  15. children: [
  16. {
  17. path: '/home/index',
  18. component: () => import('@/views/HomeView/Index.vue')
  19. },
  20. {
  21. path: '/home/index/msgDetail',
  22. component: () => import('@/views/HomeView/MsgDetail.vue')
  23. },
  24. {
  25. path: '/home/signIn',
  26. component: () => import('@/views/HomeView/SignIn.vue')
  27. },
  28. {
  29. path: '/home/myMedal',
  30. component: () => import('@/views/HomeView/MyMedal.vue')
  31. },
  32. {
  33. path: '/home/commend',
  34. component: () => import('@/views/HomeView/Commend.vue')
  35. },
  36. {
  37. path: '/home/earnPoints',
  38. component: () => import('@/views/HomeView/EarnPoints.vue')
  39. },
  40. {
  41. path: '/home/pointsMall',
  42. component: () => import('@/views/HomeView/PointsMall.vue')
  43. },
  44. {
  45. path: '/home/pointsMall/redeem',
  46. component: () => import('@/views/HomeView/RedeemView.vue')
  47. },
  48. {
  49. path: '/home/myCenter/goodsDetail',
  50. component: () => import('@/views/HomeView/GoodsDetail.vue')
  51. },
  52. {
  53. path: '/home/welfareList',
  54. component: () => import('@/views/HomeView/WelfareList.vue')
  55. },
  56. {
  57. path: '/home/myCenter',
  58. component: () => import('@/views/HomeView/MyCenter.vue')
  59. },
  60. {
  61. path: '/home/festiveEvents',
  62. component: () => import('@/views/HomeView/FestiveEvents.vue')
  63. },
  64. {
  65. path: '/home/festiveEvents/game',
  66. component: () => import('@/views/HomeView/Game.vue')
  67. }
  68. ]
  69. },
  70. {
  71. path: '/noticeCenter',
  72. component: () => import('../views/NoticeCenter.vue')
  73. },
  74. {
  75. path: '/pointsRank',
  76. component: PointsRank,
  77. redirect:'/pointsRank/present',
  78. children: [
  79. {
  80. path: '/pointsRank/present',
  81. component: () => import('@/views/PointsRank/Present.vue')
  82. },
  83. {
  84. path: '/pointsRank/history',
  85. component: () => import('@/views/PointsRank/History.vue')
  86. },
  87. ]
  88. }
  89. ]
  90. const router = new VueRouter({
  91. linkActiveClass:'route-active',
  92. routes,
  93. })
  94. export default router