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')
    },
    {
      path: '/stationBuilding',
      name: 'stationBuilding',
      component: () => import ('./views/stationBuilding.vue')
    },
    {
      path: '/twentyKV',
      name: 'twentyKV',
      component: () => import ('./views/twentyKV.vue')
    },
    {
      path: '/thirtyFiveKV',
      name: 'thirtyFiveKV',
      component: () => import ('./views/thirtyFiveKV.vue')
    },
  ]
})
