index.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. const index = () => import('@/views/index/index.vue')
  2. const cases = () => import('@/views/cases/index.vue')
  3. const services = () => import('@/views/services/index.vue')
  4. const news = () => import('@/views/news/index.vue')
  5. const about = () => import('@/views/about/index.vue')
  6. import { createRouter, createMemoryHistory, createWebHistory } from 'vue-router'
  7. const routes = [
  8. {
  9. path: "/index",
  10. name: "首页",
  11. component: index,
  12. meta: {
  13. title: "",
  14. keepAlive: false
  15. }
  16. },
  17. {
  18. path: "/cases",
  19. name: "客户案例",
  20. component: cases,
  21. meta: {
  22. title: "",
  23. keepAlive: false
  24. }
  25. },
  26. {
  27. path: "/services",
  28. name: "产品服务",
  29. component: services,
  30. meta: {
  31. title: "",
  32. keepAlive: false
  33. }
  34. },
  35. {
  36. path: "/news",
  37. name: "新闻动态",
  38. component: news,
  39. meta: {
  40. title: "",
  41. keepAlive: false
  42. }
  43. },
  44. {
  45. path: "/about",
  46. name: "关于永天",
  47. component: about,
  48. meta: {
  49. title: "",
  50. keepAlive: false
  51. }
  52. },
  53. {
  54. path: "/cases",
  55. name: "客户案例",
  56. component: cases,
  57. meta: {
  58. title: "",
  59. keepAlive: false
  60. }
  61. },
  62. ]
  63. // const router = createRouter({
  64. // history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
  65. // routes
  66. // })
  67. // export default router
  68. export function createSSRRouter(){
  69. return createRouter({
  70. history: import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
  71. routes
  72. })
  73. }