<template>
  <template v-for="(item) in props.menuList" :key="item.path">

    <el-sub-menu :index="item.path" v-if="item.children && item.children.length > 0">
      <template #title v-if="item.meta.icon">
        <el-icon>
          <Edit />
        </el-icon>
        <span>{{ item.meta.title }}</span>
      </template>
      <template #title v-else>{{ item.meta.title }}</template>
      <menuItem :menuList="(item.children as any)" />
    </el-sub-menu>
    <el-menu-item :index="item.path"  :id="'navItem'+item.path"  v-else   >
      <template v-if="item.meta.icon">
        <el-icon >
          <Search/> </el-icon>
        <span>{{ item.meta.title }}</span>
      </template>
      <template  #title >
        {{ item.meta.title }}
      </template>
    </el-menu-item>
  </template>
</template>
 
   
<script lang="ts" setup>
 
 
// 获取父组件传进来的子菜单列表
const props = defineProps({
  menuList: {
    type: Array,
    default: []
  },
  isCustomLink:{
    type: Boolean,
    default: false
  }
})

 
</script>