import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },

  {
    path: '/nav',
    name: 'nav',
    // redirect: '/nav/hostsList', // 默认跳转
    component: () => import(/* webpackChunkName: "hostsList" */ '../views/nav.vue'),
    children: [
      {
        path: 'hostsList',
        name: 'hostsList',
        component: () => import(/* webpackChunkName: "hostsList" */ '../views/hosts/hostsList.vue')
      },
      {
        path: 'workBenches',
        name: 'workBenches',
        component: () => import(/* webpackChunkName: "hostsList" */ '../views/hosts/workbenches.vue')
      },]
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
