2
0

index.js 2.7 KB

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