| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
- import Home from "./view-detail/index";
- import Notfind from "../view/notfind";
- const routes: RouteRecordRaw[] = [
- {
- path: "/",
- component: Home,
- },
- {
- path: "/product-img",
- component: () => import("./view-product-img/index"),
- },
- {
- path: "/evaluat-report",
- component: () => import("./view-evaluat-report/index"),
- },
- {
- path: "/:pathMatch(.*)*",
- component: Notfind,
- meta: {
- title: "404 Not Fund",
- },
- },
- {
- path: "/preview",
- component: () => import("./view-preview/index"),
- },
- ];
- const router = createRouter({
- history: createWebHashHistory(),
- routes,
- });
- router.beforeEach((to, from, next) => {
- if (to.meta.title) {
- document.title = to.meta.title as string;
- }
- next();
- });
- export default router;
|