import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)
//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: 'Index',
    component: () =>import('@/views/test/Test.vue')
  },
  {
    path: '/Workspace',
    name: 'Workspace',
    component: () =>import('@/views/topology/Workspace.vue')
  },
  {
    path: '/preview',
    name: 'Preview',
    component: () =>import('@/views/topology/Preview.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
