<template>
  <el-submenu :index="menu.index">
    <template #title>
      <MenuTitle :menu="menu" />
    </template>
    <template v-for="item in menu.children" :key="item.index">
      <SubMenu v-if="item.children" :menu="item" />
      <MenuItem v-else :menu="item" />
    </template>
  </el-submenu>
</template>

<script>
import MenuItem from './MenuItem.vue'
import MenuTitle from './MenuTitle.vue'

export default {
  name: 'SubMenu',

  components: {
    MenuItem,
    MenuTitle,
  },

  props: {
    menu: Object,
  },

  setup(props) {
    //
  }
}
</script>
