<template>
  <div class="navMenu">

    <label v-for="navMenu in navMenus">

      <el-menu-item v-if="navMenu.childs==null&&navMenu.entity"
                    :key="navMenu.entity.id" :data="navMenu" :index="navMenu.entity.url">
        <i :class="navMenu.entity.icon"></i>
        <span slot="title">{{navMenu.entity.title}}</span>
      </el-menu-item>

      <el-submenu v-if="navMenu.childs&&navMenu.entity"
                  :key="navMenu.entity.id" :data="navMenu" :index="navMenu.entity.url">
        <template slot="title">
          <i :class="navMenu.entity.icon"></i>
          <span>{{navMenu.entity.title}}</span>
        </template>
        <NavMenu :navMenus="navMenu.childs"></NavMenu>
      </el-submenu>
    </label>

  </div>
</template>

<script>
  export default {
    name: 'NavMenu',
    props: ['navMenus'],
    data() {
      return {}
    },
    methods: {}
  }
</script>
<style scoped>

</style>
