import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import home from "./home";

// import list from "./list";
// import list2 from "./list/list2";
// import list3 from "./list/list3";

import BasicLayout from "./backend/components/layout/BasicLayout";
import Backend from "./backend";
import BackendList from "./backend/List";
// import Total from "./backend/total";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "Home",
    component: home,
    children: [],
  },
  // {
  //   path: "/list",
  //   name: "list",
  //   component: list,
  //   children: [],
  // },
  // {
  //   path: "/list2",
  //   name: "list2",
  //   component: list2,
  // },
  // {
  //   path: "/list3",
  //   name: "list3",
  //   component: list3,
  // },
  {
    path: "/backend",
    name: "backend",
    component: BasicLayout,
    redirect: "/backend/setting",
    children: [
      {
        path: "/backend/setting",
        name: "setting",
        component: Backend,
        meta: { title: "动画设置" },
      },
      {
        path: "/backend/list",
        name: "list",
        component: BackendList,
        meta: { title: "展示数据" },
      },
    ],
  },
];

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

export const menuData = routes.find((e) => {
  return e.name == "backend";
});
export default router;
