import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/components/layout/Layout.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/home.vue'),
        meta: { title: '首页' }
      },
    ]
  }
]

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

export default router
