123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
- export const Layout = () => import("@/layout/index.vue");
- // 静态路由
- export const constantRoutes: RouteRecordRaw[] = [
- {
- path: "/redirect",
- component: Layout,
- meta: { hidden: true },
- children: [
- {
- path: "/redirect/:path(.*)",
- component: () => import("@/views/redirect/index.vue"),
- },
- ],
- },
- {
- path: "/login",
- component: () => import("@/views/login/index.vue"),
- meta: { hidden: true },
- },
- {
- path: "/",
- name: "/",
- component: Layout,
- redirect: "/process",
- children: [
- {
- path: "process",
- component: () => import("@/views/process/main.vue"),
- name: "process",
- meta: {
- title: "process",
- icon: "homepage",
- },
- },
- {
- path: "pro-steps",
- component: () => import("@/views/pro-steps/index.vue"),
- name: "pro-steps",
- meta: {
- title: "pro-steps",
- icon: "homepage",
- back: true,
- },
- children: [
- {
- path: "dianjian",
- component: () =>
- import("@/views/pro-steps/components/dianjian.vue"),
- name: "dianjian",
- meta: {
- back: true,
- },
- },
- {
- path: "duomeiticaiji",
- component: () =>
- import("@/views/pro-steps/components/duomeiticaiji.vue"),
- name: "duomeiticaiji",
- meta: {
- back: true,
- },
- },
- {
- path: "esop",
- component: () => import("@/views/pro-steps/components/ESOP.vue"),
- name: "esop",
- meta: {
- back: true,
- },
- },
- {
- path: "jingu",
- component: () => import("@/views/pro-steps/components/jingu.vue"),
- name: "jingu",
- meta: {
- back: true,
- },
- },
- {
- path: "mingpaibangding",
- component: () =>
- import("@/views/pro-steps/components/mingpaibangding.vue"),
- name: "mingpaibangding",
- meta: {
- back: true,
- },
- },
- {
- path: "Jiluxiang",
- component: () =>
- import("@/views/pro-steps/components/Jiluxiang.vue"),
- name: "Jiluxiang",
- meta: {
- back: true,
- keepAlive: true,
- },
- },
- {
- path: "shebeijilu",
- component: () =>
- import("@/views/pro-steps/components/shebeijilu.vue"),
- name: "shebeijilu",
- meta: {
- back: true,
- },
- },
- {
- path: "tiaoshipipei",
- component: () =>
- import("@/views/pro-steps/components/tiaoshipipei.vue"),
- name: "tiaoshipipei",
- meta: {
- back: true,
- },
- },
- {
- path: "wuliaocaiji",
- component: () =>
- import("@/views/pro-steps/components/wuliaocaiji.vue"),
- name: "wuliaocaiji",
- meta: {
- back: true,
- keepAlive: true,
- },
- },
- ],
- },
- ],
- },
- {
- path: "/:pathMatch(.*)*", // 必备
- component: () => import("@/views/error-page/404.vue"),
- },
- ];
- /**
- * 创建路由
- */
- const router = createRouter({
- history: createWebHashHistory(),
- routes: constantRoutes,
- // 刷新时,滚动条位置还原
- scrollBehavior: () => ({ left: 0, top: 0 }),
- });
- /**
- * 重置路由
- */
- export function resetRouter() {
- router.replace({ path: "/login" });
- }
- export default router;
|