index.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Appointments from '../views/Appointments.vue'
  4. Vue.use(VueRouter)
  5. const routes = [
  6. {
  7. path: '/',
  8. name: 'Appointments',
  9. component: Appointments
  10. },
  11. {
  12. path: '/about',
  13. name: 'About',
  14. // route level code-splitting
  15. // this generates a separate chunk (about.[hash].js) for this route
  16. // which is lazy-loaded when the route is visited.
  17. component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  18. },
  19. {
  20. path: '/search',
  21. name: 'Search',
  22. component: () => import('../views/Search.vue')
  23. },
  24. {
  25. path: '/record',
  26. redirect: '/search'
  27. },
  28. {
  29. path: '/record/:id',
  30. name: 'Record',
  31. component: () => import('../views/Record.vue')
  32. },
  33. {
  34. path: '/appointment',
  35. redirect: '/'
  36. },
  37. {
  38. path: '/appointment/:id',
  39. name: 'Appointment',
  40. component: () => import('../views/Appointment.vue')
  41. }
  42. ]
  43. const router = new VueRouter({
  44. // base: "/apps/appointments_alternate",
  45. routes
  46. })
  47. export default router