| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import Vue from 'vue';
- import VueRouter from 'vue-router';
- import layout from '@/layout/index.vue';
- const originalPush = VueRouter.prototype.push;
- VueRouter.prototype.push = function push(location) {
- return originalPush.call(this, location).catch((err) => err);
- };
- Vue.use(VueRouter);
- const router = new VueRouter({
- mode: 'history',
- // scrollBehavior(to, from, savedPosition) {
- // if (savedPosition) {
- // return savedPosition;
- // } else {
- // return { x: 0, y: 0 };
- // }
- // },
- base: '/agent/',
- routes: [
- {
- path: '/',
- component: layout,
- redirect: '/home',
- children: [
- {
- path: '/home',
- name: 'home',
- component: () => import('@/views/home/index.vue'),
- meta: {
- title: '经销商拜访',
- },
- },
- {
- path: '/visitPage',
- name: 'visitPage',
- component: () => import('@/views/home/visitPage.vue'),
- meta: {
- title: '拜访详情',
- },
- },
- {
- path: '/visitTask',
- name: 'visitTask',
- component: () => import('@/views/home/visitTask.vue'),
- meta: {
- title: '拜访任务',
- },
- },
- {
- path: '/visitHistory',
- name: 'visitHistory',
- component: () => import('@/views/home/visitHistory.vue'),
- meta: {
- title: '拜访历史',
- },
- },
- ],
- },
- {
- path: '/err',
- name: 'err',
- component: () => import('@/views/err.vue'),
- meta: {
- title: '404',
- },
- },
- {
- path: '/login',
- name: 'login',
- component: () => import('@/views/login.vue'),
- meta: {
- title: '登录',
- },
- },
- ],
- });
- export default router;
|