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: 'address',
          name: 'addressBook',
          component: () => import('@/views/addressBook.vue')
        },
        {
          path: 'manage',
          name: 'classManage',
          component: () => import('@/views/classManagement.vue')
        },
        {
          path: 'disk',
          name: 'disk',
          component: () => import('@/views/Disk.vue')
        },
        {
          path: 'news',
          name: 'news',
          component: () => import('@/views/News.vue')
        },
        {
          path: 'note',
          name: 'note',
          component: () => import('@/views/Note.vue')
        },
        {
          path: 'account',
          name: 'account',
          component: () => import('@/views/Account.vue')
        },
        {
          path: 'home',
          name: 'home',
          component: () => import('@/views/Hone.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