<template>
  <div class="slide">
    <el-menu
      :default-active="(router.currentRoute.value.name as string)"
      @select="(name: string) => router.push({ name })"
    >
      <sub-menu
        v-for="route in routes"
        :meta="route.meta"
        :name="(route.name as string)"
        :key="route.name"
      />
    </el-menu>
  </div>
</template>

<script setup lang="ts">
import subMenu from "./submenu.vue";
import { router, findRoute } from "@/router";

const names = ["scene", "relics", "device"];
const routes = names.map((name) => findRoute(name)!);
</script>

<style lang="scss" scoped>
.slide {
  background: #ffffff;
}
</style>
