index.ts 2.5 KB

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