import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Layout from '@/layout'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            name: 'Layout',
            redirect: '/login',
            component: Layout,
            children: [
                {
                    path: 'home',
                    name: 'Home',
                    component: () => import('@/views/home')
                },
                {
                    path: 'order',
                    name: 'Order',
                    component: () => import('@/views/order')
                },
                {
                    path: 'staff',
                    name: 'Staff',
                    component: () => import('@/views/staff')
                },
                {
                    path: 'account',
                    name: 'Account',
                    component: () => import('@/views/account')
                },
                {
                    path: 'stat',
                    name: 'Stat',
                    component: () => import('@/views/stat')
                },
                {
                    path: 'system',
                    name: 'System',
                    component: () => import('@/views/system')
                },
                {
                    path: 'inform',
                    name: 'Inform',
                    component: () => import('@/views/inform')
                }
            ]
        },
        // 登录页
        {
            path: '/login',
            component: () => import('@/views/login/index'),
            hidden: true
        },
    ]
})