12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { createRouter, createWebHistory } from "vue-router";
- const routes=[
- {
- path: "/",
- name: "Layout",
- redirect:'/update/index',
- component: ()=>import("@/layouts/Index.vue"),
- children:[
- {
- path:"/help/index",
- name:"HelpIndex",
- component: () => import("@/views/help/Index.vue"),
- meta: {
- title: "帮助中心",
- },
- },
- {
- path:"/update/index",
- name:"UpdateIndex",
- component: () => import("@/views/update/Index.vue"),
- meta: {
- title: "ETA投研系统更新日志",
- },
- },
- ]
- },
- {
- path: "/:pathMatch(.*)",
- name: "error",
- component: () => import("@/views/404.vue"),
- meta: { title: "404" },
- },
- ]
- const router = createRouter({
- history: createWebHistory(import.meta.env.VITE_APP_BASE_URL),
- routes,
- });
- router.beforeEach((to, from, next) => {
- document.title = to.meta.title;
- next();
- });
- export default router;
|