<script setup>
import { computed } from "vue";
import { useRoute } from "vue-router";

const route = useRoute();

const menuItems = [
 
  { name: "agent-users", label: "用户管理", to: "/agent/users" },
  { name: "agent-card-keys", label: "卡密管理", to: "/agent/card-keys" },

];

const activeName = computed(() => route.name);
</script>

<template>
  <nav class="admin-sub-nav" aria-label="管理后台导航">
    <p class="admin-sub-nav__title"></p>
    <RouterLink
      v-for="item in menuItems"
      :key="item.name"
      :to="item.to"
      class="admin-sub-nav__item"
      :class="{ 'admin-sub-nav__item--active': activeName === item.name }"
    >
      {{ item.label }}
    </RouterLink>
  </nav>
</template>
