<template>
  <MenuItem
    :is-menu="true"
    v-bind="$attrs"
  >
    <template v-slot:default>
      <!-- 子菜单标题 -->
      <slot name="title" />
    </template>
    <template
      v-slot:icon
      v-if="$scopedSlots.icon"
    >
      <!-- 子菜单 icon -->
      <slot name="icon" />
    </template>
    <template v-slot:children>
      <slot name="child" />
      <slot name="children" />
    </template>
  </MenuItem>
</template>

<script>
import MenuItem from './menu-item';

export default {
  components: {
    MenuItem
  },
  inject: ['menu']
};

</script>
