import { createRouter, createWebHashHistory } from 'vue-router';

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'root',
      redirect: '/thenew', 
      component: () => import('@/views/TheNewView.vue'), 
      children: [
        {
          path: 'thenew',
          name: 'thenew',
          // component: () => import('@/views/HomeView.vue'), // HomeView 是 TheNewView 的子组件
          redirect: '/thenew/nodata', // 默认重定向到 /thenew/hour-line
          children: [
            {
              path: 'hour-line',
              name: 'hour-line',
              component: () => import('@/end/NewDesign.vue')
            },
            {
              path: 'hour-line2',
              name: 'hour-line2',
              component: () => import('@/endnew/NewStyleDesign.vue')
            },
            {
              path: 'day-line',
              name: 'day-line',
              component: () => import('@/end/NodataView.vue')
            },
            {
              path: 'week-line',
              name: 'week-line',
              component: () => import('@/end/NodataView.vue')
            },
            {
              path: 'month-line',
              name: 'month-line',
              component: () => import('@/end/NodataView.vue')
            },
            {
              path: 'year-line',
              name: 'year-line',
              component: () => import('@/end/NodataView.vue')
            },
            {
              path: 'nodata',
              name: 'nodata',
              component: () => import('@/end/NodataView.vue')
            }
          ]
        }
      ]
    }
  ]
});

export default router;