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

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

const props = defineProps<{ names: string[] }>();

const routes = getPermissionRoutes(props.names);
console.log(routes, 'routes', props.names);
</script>

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