import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router";

// 2. 配置路由
const routes: Array<RouteRecordRaw> = [
    {
        name: "home",
        path: "/",
        component: () => import("../page/Login.vue"),
        children: []
    },
    {
        name: "back",
        path: "/back",
        component: () => import("../page/back/index.vue"),
        children: [
            {
                name: "back-home",
                path: "base",
                component: () => import("../page/back/BackBaseView.vue"),
            },
            {
                name: "back-base",
                path: "home",
                component: () => import("../page/back/BackBaseView.vue"),
            },
            {
                name: "back-message",
                path: "message",
                component: () => import("../page/back/MessagesView.vue"),
            },
            {
                name: "back-vip",
                path: "vip",
                component: () => import("../page/back/VIPView.vue"),
            },
            {
                name: "back-general",
                path: "general",
                component: () => import("../page/back/GeneralView.vue"),
            },
            {
                name: "back-kit",
                path: "kit",
                component: () => import("../page/back/KitsView.vue"),
            },
            {
                name: "back-shopItem",
                path: "shopItem",
                component: () => import("../page/back/ShopItemView2.vue"),
            },
            {
                name: "back-shopItem2",
                path: "shopItem/:activeName",
                component: () => import("../page/back/ShopItemView2.vue"),
            },
            {
                name: "back-sellItem",
                path: "sellItem",
                component: () => import("../page/back/SellItemView.vue"),
            },
            {
                name: "ARKItemsApi",
                path: "arkItem",
                component: () => import("../page/back/ARKItemListView.vue"),
            },
            {
                name: "ARKDinosApi",
                path: "arkDino",
                component: () => import("../page/back/ARKDinoListView.vue"),
            },
        ],
    },
];

// 1.返回一个 router 实列，为函数，里面有配置项（对象） history
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
});
export default router