import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Layout,
      children: [
        {
          path: '',
          name: 'myclass',
          component: () => import('@/views/MyClass.vue')
        },
        {
          path: 'newclass',
          name: 'newclass',
          component: () => import('@/views/NewClass.vue')
        },
        {
          path: 'account',
          name: 'account',
          component: () => import('@/views/Account.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',

      component: () => import('@/views/Login.vue')
    },
    {
      path: '/code',
      name: 'code',

      component: () => import('@/views/Code.vue')
    },
    {
      path: '/detail',
      name: 'detail',

      component: () => import('@/views/ClassDetail.vue')
    }
  ]
})

export default router