index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import { createRouter, createWebHashHistory } from "vue-router";
  2. import { defineComponent } from "vue";
  3. /**
  4. * @type {import("vue-router").RouteRecordRaw[]}
  5. */
  6. const routes = [
  7. {
  8. path: "/",
  9. name: "home",
  10. redirect: {
  11. name: "sdk",
  12. },
  13. },
  14. {
  15. path: "/install",
  16. name: "install",
  17. component: defineComponent({
  18. name: "DynamicComponent",
  19. render() {
  20. return <router-view></router-view>;
  21. },
  22. }),
  23. children: [
  24. {
  25. path: "",
  26. name: "install",
  27. component: () =>
  28. import(/* webpackChunkName: "install" */ "../views/install.vue"),
  29. },
  30. ],
  31. },
  32. {
  33. path: "/svg",
  34. name: "svg",
  35. component: defineComponent({
  36. name: "DynamicComponent",
  37. render() {
  38. return <router-view></router-view>;
  39. },
  40. }),
  41. children: [
  42. {
  43. path: "",
  44. name: "svg",
  45. component: () =>
  46. import(/* webpackChunkName: "svg" */ "../views/svg/index.vue"),
  47. },
  48. ],
  49. },
  50. {
  51. path: "/sdk",
  52. name: "sdk",
  53. component: defineComponent({
  54. name: "DynamicComponent",
  55. render() {
  56. return <router-view></router-view>;
  57. },
  58. }),
  59. children: [
  60. {
  61. path: "queue",
  62. name: "queue",
  63. component: () =>
  64. import(/* webpackChunkName: "queue" */ "../views/queue.vue"),
  65. },
  66. {
  67. path: "async",
  68. name: "async",
  69. component: () =>
  70. import(/* webpackChunkName: "async" */ "../views/async.vue"),
  71. },
  72. {
  73. path: "storage",
  74. name: "storage",
  75. component: () =>
  76. import(/* webpackChunkName: "storage" */ "../views/storage.vue"),
  77. },
  78. {
  79. path: "flexible",
  80. name: "flexible",
  81. component: () =>
  82. import(/* webpackChunkName: "flexible" */ "../views/flexible.vue"),
  83. },
  84. {
  85. path: "http",
  86. name: "http",
  87. component: () =>
  88. import(/* webpackChunkName: "http" */ "../views/http.vue"),
  89. },
  90. {
  91. path: "formula",
  92. name: "formula",
  93. component: () =>
  94. import(/* webpackChunkName: "formula" */ "../views/formula.vue"),
  95. },
  96. {
  97. path: "thread",
  98. name: "thread",
  99. component: () =>
  100. import(/* webpackChunkName: "thread" */ "../views/thread.vue"),
  101. },
  102. {
  103. path: "",
  104. redirect: {
  105. name: "queue",
  106. },
  107. },
  108. {
  109. path: "/:pathMatch(.*)",
  110. redirect: {
  111. name: "queue",
  112. },
  113. },
  114. ],
  115. },
  116. ];
  117. const router = createRouter({
  118. history: createWebHashHistory(),
  119. routes,
  120. });
  121. export default router;