You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
Vue
47 lines
1.3 KiB
Vue
8 years ago
|
<template>
|
||
8 years ago
|
<div>
|
||
|
<template v-for="item in routes">
|
||
|
<router-link v-if="!item.hidden&&item.noDropdown&&item.children.length>0" :to="item.path+'/'+item.children[0].path">
|
||
|
<el-menu-item :index="item.path+'/'+item.children[0].path">
|
||
|
<icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.children[0].name}}
|
||
|
</el-menu-item>
|
||
|
</router-link>
|
||
|
<el-submenu :index="item.name" v-if="!item.noDropdown&&!item.hidden">
|
||
|
<template slot="title">
|
||
|
<icon-svg v-if='item.icon' :icon-class="item.icon" /> {{item.name}}
|
||
8 years ago
|
</template>
|
||
8 years ago
|
<template v-for="child in item.children" v-if='!child.hidden'>
|
||
|
<sidebar-item class='menu-indent' v-if='child.children&&child.children.length>0' :routes='[child]'> </sidebar-item>
|
||
|
<router-link v-else class="menu-indent" :to="item.path+'/'+child.path">
|
||
|
<el-menu-item :index="item.path+'/'+child.path">
|
||
|
{{child.name}}
|
||
|
</el-menu-item>
|
||
|
</router-link>
|
||
|
</template>
|
||
|
</el-submenu>
|
||
|
</template>
|
||
|
</div>
|
||
8 years ago
|
</template>
|
||
|
|
||
|
<script>
|
||
8 years ago
|
export default {
|
||
|
name: 'SidebarItem',
|
||
|
props: {
|
||
|
routes: {
|
||
|
type: Array
|
||
8 years ago
|
}
|
||
8 years ago
|
}
|
||
|
}
|
||
8 years ago
|
</script>
|
||
|
|
||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||
8 years ago
|
.svg-icon {
|
||
|
margin-right: 10px;
|
||
|
}
|
||
|
.hideSidebar .menu-indent{
|
||
|
display: block;
|
||
|
text-indent: 10px;
|
||
|
}
|
||
8 years ago
|
</style>
|
||
|
|