fayuanjiangbei/src/router.js

29 lines
523 B
JavaScript

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
}
export default new Router({
mode: 'history',
base: process.env.BASE_URL,
routes: [
{
path: '/',
redirect:'/index',
},
{
path: '/index',
name: 'index',
component: () => import ('./views/index.vue'),
},
]
})