index.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { createRouter, createWebHistory } from 'vue-router'
  2. const router = createRouter({
  3. history: createWebHistory(),
  4. scrollBehavior(to) {
  5. if (to.hash) {
  6. return { el: to.hash, behavior: 'smooth', top: 20 }
  7. }
  8. return { top: 0 }
  9. },
  10. routes: [
  11. {
  12. path: '/',
  13. redirect: '/dashboard',
  14. },
  15. {
  16. path: '/dashboard',
  17. name: 'dashboard',
  18. component: () => import('../views/Dashboard.vue'),
  19. },
  20. {
  21. path: '/compose',
  22. name: 'compose',
  23. component: () => import('../views/Compose.vue'),
  24. },
  25. {
  26. path: '/scheduler',
  27. name: 'scheduler',
  28. component: () => import('../views/Scheduler.vue'),
  29. },
  30. {
  31. path: '/media',
  32. name: 'media',
  33. component: () => import('../views/Media.vue'),
  34. },
  35. {
  36. path: '/analytics',
  37. name: 'analytics',
  38. component: () => import('../views/Analytics.vue'),
  39. },
  40. {
  41. path: '/competitors',
  42. name: 'competitors',
  43. component: () => import('../views/Competitors.vue'),
  44. },
  45. {
  46. path: '/calendar-plan',
  47. name: 'calendarPlan',
  48. component: () => import('../views/CalendarPlan.vue'),
  49. },
  50. {
  51. path: '/settings',
  52. name: 'settings',
  53. component: () => import('../views/Settings.vue'),
  54. },
  55. {
  56. path: '/global-settings',
  57. name: 'globalSettings',
  58. component: () => import('../views/GlobalSettings.vue'),
  59. },
  60. ],
  61. })
  62. export default router