<template>
	<!-- 	<Submenu v-if="menu.children.length>=1" :name="menu.id">
		<template slot="title">
			
			{{menu.text}}
		</template>
		<SideMenuItem v-for="item in menu.children" :key="item.id" :menu="item"></SideMenuItem>

	</Submenu>

	<MenuItem v-else :name="menu.url">{{menu.text}}</MenuItem>
 -->
	 
		<el-submenu v-if="menu.children.length>=1" :index="menu.code" >
			<template slot="title">
				<i class="el-icon-plus"  ></i>
				<span slot="title">{{menu.text}}</span>
			</template>
			<SideMenuItem v-for="item in menu.children" :key="item.id" :menu="item"   ></SideMenuItem>
		</el-submenu>
		<el-menu-item v-else-if="menu.state==='0'" :index= "menu.url">	<template slot="title">
				<i class="el-icon-minus" ></i>
				<span slot="title">{{menu.text}}</span>
			</template></el-menu-item>


	 
</template>
<script>
	export default {
		name: 'SideMenuItem',
		props: {
			menu: {
				type: Object,
				required: true
			}  
		}

	}
</script>
