| | |
| | | <template> |
| | | <div v-if="!item.hidden"> |
| | | <template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> |
| | | <template |
| | | v-if="hasOneShowingChild(item.children, item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) && !item.alwaysShow"> |
| | | <app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)"> |
| | | <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> |
| | | <item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> |
| | | <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }"> |
| | | <item :icon="onlyOneChild.meta.icon || (item.meta && item.meta.icon)" :title="onlyOneChild.meta.title" /> |
| | | </el-menu-item> |
| | | </app-link> |
| | | </template> |
| | |
| | | <template slot="title"> |
| | | <item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> |
| | | </template> |
| | | <sidebar-item |
| | | v-for="(child, index) in item.children" |
| | | :key="child.path + index" |
| | | :is-nest="true" |
| | | :item="child" |
| | | :base-path="resolvePath(child.path)" |
| | | class="nest-menu" |
| | | /> |
| | | <sidebar-item v-for="(child, index) in item.children" :key="child.path + index" :is-nest="true" :item="child" |
| | | :base-path="resolvePath(child.path)" class="nest-menu" /> |
| | | </el-submenu> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | // Show parent if there are no child router to display |
| | | if (showingChildren.length === 0) { |
| | | this.onlyOneChild = { ... parent, path: '', noShowingChildren: true } |
| | | this.onlyOneChild = { ...parent, path: '', noShowingChildren: true } |
| | | return true |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | ::v-deep .el-submenu__title i { |
| | | color: #ffffff !important; |
| | | } |
| | | </style> |