<template>

        <el-menu :key="activeMenu" class="el-menu-vertical-demo" :default-active="activeMenu" :mode="mode"
            :collapse="isCollapse" router :ellipsis="false" :default-openeds="defaultOpeneds">
            <NavBarMenuItem :items="routes" :isNested="isNested" :activeMenu="activeMenu" :isIcon="isIcon" />
            <slot name="moretitle"></slot>
        </el-menu>
  
</template>

<script setup>
import { ref, computed, watch } from 'vue'
import NavBarMenuItem from './NavBarMenuItem.vue'

const props = defineProps({
    routes: {
        type: Array,
        default: () => []
    },
    // 是否折叠
    isCollapse: {
        type: Boolean,
        default: false,
    },
    mode: {
        type: String,
        default: 'vertical',
    },
    isNested: {
        type: Boolean,
        default: true,
    },
    activeMenu: {
        type: String,
        default: '',
    },
    isIcon: {
        type: Boolean,
        default: true,
    },
    // 默认展开的子菜单 index 列表
    defaultOpeneds: {
        type: Array,
        default: () => [],
    }
})

</script>
