import Vue from "vue"
import Router from "vue-router"
import ViewUI from "view-design"
Vue.use(Router)

const asyncRoutes = [
  {
    path: "/",
    name: "Home",
    redirect: "/datachart",
    component: () => import("./components/layout/Main.vue"),
    children: [
      // 数据分析
      {
        path: "/datachart",
        name: "databoard",
        component: () => import("./views/databoard/index.vue")
      },
      {
        path: "/databoard",
        name: "databoards",
        component: () => import("./views/databoards/index.vue")
      }
    ]
  }
]

const router = new Router({
  routes: asyncRoutes
})
router.afterEach((route) => {
  ViewUI.LoadingBar.finish()
})
export default router
