import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 静态路由
const constantRoutes = [
  { path: '/404', component: () => import('@/views/errorPage/404.vue'), hidden: true },
  { path: '/401', component: () => import('@/views/errorPage/401.vue'), hidden: true },
  { path: '/', name: 'index', component: () => import('@/views/screen/home') },
  { path: '/lineChart', name: 'lineChart', component: () => import('../docs/LineChart.md')},
  { path: '*', redirect: '/404',hidden: true}
]

const router = new VueRouter({
  // mode: "history", // 后端支持可开
  scrollBehavior: ()=>({y:0}), // 每次跳转后是滚动条回到头部位置
  routes: constantRoutes
})

export default router
