import Vue from 'vue'
import Router from 'vue-router'

/* 结构 */
import Layout from '@/layout'
/* 主页 */
const Lottery = () => import('@/views/lottery')
/* 场次列表 */
const SessionList = () => import('@/views/lottery/sessionList')
/* 404 */
const Lost = () => import('@/views/errorPage/404')

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  linkActiveClass: 'z-active',
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Layout,
      children: [
        {
          path: '/index',
          name: 'Lottery',
          component: Lottery
        },
        {
          path: '/list',
          name: 'SessionList',
          component: SessionList
        }
      ]
    },
    {
      path: '/404',
      name: '404',
      component: Lost
    },
    {
      path: '*',
      name: '404',
      component: Lost
    }
  ]
})
