import Vue from 'vue';
import VueRouter from 'vue-router';
import HomeView from '../views/HomeView.vue';
import UserList from '@/components/list.vue'; // 账号列表组件
import UserExamine from '@/components/examine.vue'; // 账号审核组件

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/user-list', // 默认跳转到账号列表
    children: [
      {
        path: 'user-list',
        name: 'UserList',
        component: UserList,
      },
      {
        path: 'user-examine',
        name: 'UserExamine',
        component: UserExamine,
      },
    ],
  },
  {
    path: '/examineDialog',
    name: 'examineDialog',
    component: () => import(/* webpackChunkName: "examineDialog" */ '../views/examineDialog.vue'),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
