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

// import generatedRoutes from 'virtual:generated-pages'
// const routes = generatedRoutes

const routes =[
  {
    name: 'index',
    path: '/',
    props: true,
    redirect: '/tree',
  },
  {
    path: '/tree',
    component: () => import('~/pages/tree.vue'),
    children: [
      {
        name: 'tree',
        path: '',
        props: true,
        component: () => import('~/pages/tree/index.vue'),
        meta: {
          breadcrumb: false,
        },
      },
      {
        name: 'tree-area',
        path: ':area',
        component: () => import('~/pages/tree/[area].vue'),
        props: true,
      },
    ],
    props: true,
  },
  // {
  //   name: 'grid-area',
  //   path: '/grid/:area',
  //   props: true,
  //   component: () => import('~/pages/grid/[area].vue'),
  // },
  // {
  //   name: 'chart-area',
  //   path: '/chart/:area',
  //   props: true,
  //   component: () => import('~/pages/chart/[area].vue'),
  // },
]

const router = createRouter({
  history: createWebHashHistory(),
  // history: createWebHistory(),
  routes: routes,
})

export default router
