import Vue from 'vue'
import VueRouter from 'vue-router'
import ChildrenRouters from './ChildrenRouters.js'

Vue.use(VueRouter)

let mainRouterChildren = [];
mainRouterChildren = mainRouterChildren.concat(ChildrenRouters)

const routes = [
  {
    path: '/',
    name: 'MainLayout',
    component: () => import('../views/MainLayout.vue'),
    children: mainRouterChildren
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login/Login.vue'),
    meta: {
      title: '登录',
    },
  }
]

const router = new VueRouter({
  routes
})


export default router
