import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '',
    component: () => import('@/layouts/default'),
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('../pages/index/index'),
      },
      {
        path: '/list',
        name: 'list',
        component: () => import('../pages/list/index'),
      },
      {
        path: '/message',
        name: 'message',
        component: () => import('../pages/message/index'),
      },
      {
        path: '/recordDetail',
        name: 'recordDetai/',
        component: () => import('../pages/recordDetail/index'),
      },
      {
        path: '/records',
        name: 'records',
        component: () => import('../pages/records/index'),
      },
      {
        path: '/winners',
        name: 'winners',
        component: () => import('../pages/winners/index'),
      },
      {
        path: '/config',
        name: 'config',
        component: () => import('../pages/config/index'),
      },
    ]
  },
  {
    path: '/mini',
    name: 'mini',
    component: () => import('@/layouts/miniNavBar'),
    children: [
      {
        path: '/mini/index',
        name: 'mini-index',
        component: () => import('../pages/mini/index/index'),
      },
      {
        path: '/mini/list',
        name: 'mini-list',
        component: () => import('../pages/mini/list/index'),
      },
    ]
  },
  {
    path: '/error',
    name: '404',
    component: () => import('@/layouts/error'),
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
