1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- Vue.use(VueRouter)
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch(err => err)
- }
- const routes = [
- {
- path: "/",
- component: () => import('@/views/index'),
- },
- {
- path:'/login',
- name:'Login',
- meta: {
- title: '系统登录'
- },
- component: () => import("@/views/login/index.vue")
- },
- {
- path: "",
- component: () => import('@/views/layout/index.vue'),
- children:[
- {
- path:'/caseList',
- name:'CaseList',
- meta: {
- title: '案件列表'
- },
- component: () => import("@/views/caseList/index.vue")
- },
- {
- path:'/differenceDetails',
- name:'DifferenceDetails',
- meta: {
- title: '差异度详情'
- },
- component: () => import("@/views/differenceDetails/index.vue")
- },
- //查看文件
- {
- path: '/checkFile',
- name: '/checkFile',
- meta: {
- aside: true,
- sign: 'checkFile',
- },
- component: () => import('@/views/components/view/checkFile.vue'),
- },
- ]
- },
-
-
- ]
- const router = new VueRouter({
- mode: 'history',
- base: '/',
- routes
- })
- router.beforeEach((to, from, next) => {
- if (to.meta.title) {
- document.title = to.meta.title;
- }
- next();
- })
- router.afterEach((to, from) => {
- });
- export default router
|