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'),
      //   //路由嵌套
      //   children:[
      //     {path: '/main',component: () => import('./views/main.vue')},
      //     {path: '/main1',component: () => import('./views/main1.vue')},
      // ]
    },
  ]
})
