router.ts 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
  2. import Home from "./modeEntry";
  3. import Notfind from "../view/notfind";
  4. const routes: RouteRecordRaw[] = [
  5. {
  6. path: "/",
  7. component: Home,
  8. },
  9. {
  10. path: "/product-img",
  11. component: () => import("/src/view/transfer-to-img/index"),
  12. },
  13. {
  14. path: "/evaluat-report",
  15. component: () => import("./view-evaluat-report/index"),
  16. },
  17. {
  18. path: "/preview",
  19. component: () => import("./view-preview/index"),
  20. },
  21. {
  22. path: "/view-figner",
  23. component: () => import("./view-figner/index"),
  24. },
  25. {
  26. path: "/:pathMatch(.*)*",
  27. component: Notfind,
  28. meta: {
  29. title: "404 Not Fund",
  30. },
  31. },
  32. ];
  33. const router = createRouter({
  34. history: createWebHashHistory(),
  35. routes,
  36. });
  37. router.beforeEach((to, from, next) => {
  38. if (to.meta.title) {
  39. document.title = to.meta.title as string;
  40. }
  41. next();
  42. });
  43. export default router;