<template>
  <template v-for="item in menuList">
    <el-sub-menu v-if="item.children" :key="item.path  + item.name"  :index="item.path + item.name">
      <template #title>
        <!--        <el-icon >-->
        <!--          <edit />-->
        <!--        </el-icon>-->
        <span class="layer-1-title">{{item.name}}</span>
      </template>
      <menu-i :menu-list="item.children"/>
    </el-sub-menu>
    <el-menu-item @click="homeCountAdd" v-else :key="item.path  + item.name" :route="{name:item.path}" :index="item.path + item.name" >
      <template #title>
        <div class="layer-1-title">{{item.name}}</div>
      </template>
    </el-menu-item>
  </template>
</template>

<script>
//import {Edit} from "@element-plus/icons-vue";
import {useRootStore} from "@/pinia/useStore";

export default {
  name: "MenuI",
  //components: {Edit},
  props:{
    menuList:{

    }
  },
  setup() {
    const store= useRootStore()
    function homeCountAdd() {
      store.toHomeCounter++
    }
    return {
      homeCountAdd
    }
  }
}
</script>

<style scoped lang="scss">

</style>
