<template>
  <router-link :to="routeName">
    <el-menu-item :index="menu.index">
      <MenuTitle :menu="menu" />
    </el-menu-item>
  </router-link>
</template>

<script>
import { computed } from 'vue'
import MenuTitle from './MenuTitle.vue'

export default {
  components: {
    MenuTitle,
  },

  props: {
    menu: Object,
  },

  setup(props) {
    const routeName = computed(() => ({name: props.menu.route.name}))

    return {
      routeName,
    }
  }
}
</script>
