/* * @Autor: Chuting * @Date: 2022-08-08 14:23:52 * @LastEditors: Chuting * @LastEditTime: 2022-08-10 23:19:14 * @Description: */ import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(VueRouter) // 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题 const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) } const routes = [ { path: '/', name: 'Home', // component: Home component: ()=> import("../components/home/home"), }, { path: '/aboutUe', name: 'aboutUe', // component: Home component: ()=> import("../components/aboutUe/aboutUe"), }, { path: '/styleAdd/:id?', name: 'styleAdd', // component: Home component: ()=> import("../components/styleAdd/styleAdd"), }, { path: '/case', name: 'case', component: ()=> import("@/components/case"), }, { path: '/technology', name: 'technology', component: ()=> import("@/components/technology"), }, { path: '/introduce/:id?', name: 'introduce', component: ()=> import("@/components/introduce"), } ] const router = new VueRouter({ mode: 'history', base: process.env.BASE_URL, routes }) export default router