zhangwei
2025-12-23 58f8f8dcc6b0a86eb7ed3d4b8acb7778614a0213
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import { createRouter, createWebHistory } from 'vue-router'
import $store from "@/store/index.js";
// 开启历史模式
// vue2中使用 mode: history 实现
const routerHistory = createWebHistory();
 
const router = createRouter({
  history: routerHistory,
  routes: [{
    path: "/",
    name: "main",
    component: () => import("../views/main.vue"),
    children: [
      {
        //实现路由重定向,当进入网页时,路由自动跳转到/student路由
        redirect: '/index',
        path: '/'
      },
      {
        path: "/index",
        name: "index",
        component: () => import("../views/index/index.vue"),
        meta: { title: "" }
      },
      {
        path: "/aboutus",
        name: "aboutus",
        component: () => import("../views/aboutus/index.vue"),
        meta: { title: "关于川印" }
      },
      {
        path: "/qualification",
        name: "qualification",
        component: () => import("../views/aboutus/qualification.vue"),
        meta: { title: "资质认证" }
      },
      {
        path: "/service",
        name: "service",
        component: () => import("../views/aboutus/service.vue"),
        meta: { title: "川印服务" }
      },
      {
        path: "/development",
        name: "development",
        component: () => import("../views/aboutus/development.vue"),
        meta: { title: "发展规划" }
      },
      {
        path: "/examination",
        name: "examination",
        component: () => import("../views/business/examination.vue"),
        meta: { title: "考试试卷" }
      },
      {
        path: "/yiyuan",
        name: "yiyuan",
        component: () => import("../views/business/yiyuan.vue"),
        meta: { title: "医院印刷品" }
      },
      {
        path: "/workbook",
        name: "workbook",
        component: () => import("../views/business/workbook.vue"),
        meta: { title: "作业簿册" }
      },
      {
        path: "/assembly",
        name: "assembly",
        component: () => import("../views/business/assembly.vue"),
        meta: { title: "资料汇编" }
      },{
        path: "/magazine",
        name: "magazine",
        component: () => import("../views/business/magazine.vue"),
        meta: { title: "期刊杂志" }
      },{
        path: "/enrollment",
        name: "enrollment",
        component: () => import("../views/business/enrollment.vue"),
        meta: { title: "招生资料" }
      },
      {
        path: "/other",
        name: "other",
        component: () => import("../views/business/other.vue"),
        meta: { title: "其它印刷品" }
      },
      {
        path: "/servecustomers",
        name: "servecustomers",
        component: () => import("../views/servecustomers/index.vue"),
        meta: { title: "服务客户" }
      },
      {
        path: "/equipment",
        name: "equipment",
        component: () => import("../views/equipment/index.vue"),
        meta: { title: "设备实力" }
      },
      {
        path: "/join",
        name: "join",
        component: () => import("../views/join/index.vue"),
        meta: { title: "商务合作" }
      },
      
        ]
      },
    {
      path: "/tologin",
      name: "tologin",
      component: () => import("../views/login/index.vue"),
      meta: { title: "登录" }
    }]
  }, 
)
router.beforeEach((to, from, next) => {
  // console.log("to",to)
  // console.log("from",from)
  let crumblist = [{
    name: from.meta.title,
    path: from.fullPath
  }, {
    name: to.meta.title,
    path: to.fullPath
  },]
  $store().setcrumb(crumblist)
  $store().sethdmen(to.path)
  // console.log("from", $store().crumb)
  next()
 
})
 
export default router