index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import HomeView from '../views/HomeView.vue'
  4. Vue.use(VueRouter)
  5. const routes = [
  6. {
  7. path:'/',
  8. redirect:'/home',
  9. },
  10. {
  11. path: '/home',
  12. component: HomeView,
  13. redirect:'home/employeeDynamics',
  14. children: [
  15. {
  16. path: '/home/employeeDynamics',
  17. component: () => import('@/views/HomeView/EmployeeDynamics.vue')
  18. },
  19. {
  20. path: '/home/pointsMall',
  21. component: () => import('@/views/HomeView/PointsMall.vue')
  22. },
  23. {
  24. path: '/home/pointsMall/redeem',
  25. component: () => import('@/views/HomeView/RedeemView.vue')
  26. },
  27. {
  28. path: '/home/welfareList',
  29. component: () => import('@/views/HomeView/WelfareList.vue')
  30. },
  31. {
  32. path: '/home/festiveEvents',
  33. component: () => import('@/views/HomeView/FestiveEvents.vue')
  34. }
  35. ]
  36. },
  37. {
  38. path: '/noticeCenter',
  39. component: () => import('../views/NoticeCenter.vue')
  40. },
  41. {
  42. path: '/pointsRank',
  43. component: () => import('../views/PointsRank.vue')
  44. }
  45. ]
  46. const router = new VueRouter({
  47. mode: 'history',
  48. linkActiveClass:'route-active',
  49. routes,
  50. })
  51. export default router