|
|
|
@ -1,6 +1,7 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div v-if="!item.hidden">
|
|
|
|
<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)">
|
|
|
|
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
|
|
|
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
|
|
|
<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" />
|
|
|
|
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
|
|
|
|
@ -12,28 +13,27 @@
|
|
|
|
<template slot="title">
|
|
|
|
<template slot="title">
|
|
|
|
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
|
|
|
|
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<sidebar-item
|
|
|
|
<sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child"
|
|
|
|
v-for="child in item.children"
|
|
|
|
:base-path="resolvePath(child.path)" class="nest-menu" />
|
|
|
|
:key="child.path"
|
|
|
|
|
|
|
|
:is-nest="true"
|
|
|
|
|
|
|
|
:item="child"
|
|
|
|
|
|
|
|
:base-path="resolvePath(child.path)"
|
|
|
|
|
|
|
|
class="nest-menu"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-submenu>
|
|
|
|
</el-submenu>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import path from 'path'
|
|
|
|
import path from 'path'
|
|
|
|
import { isExternal } from '@/utils/validate'
|
|
|
|
import {
|
|
|
|
import Item from './Item'
|
|
|
|
isExternal
|
|
|
|
import AppLink from './Link'
|
|
|
|
} from '@/utils/validate'
|
|
|
|
import FixiOSBug from './FixiOSBug'
|
|
|
|
import Item from './Item'
|
|
|
|
|
|
|
|
import AppLink from './Link'
|
|
|
|
|
|
|
|
import FixiOSBug from './FixiOSBug'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'SidebarItem',
|
|
|
|
name: 'SidebarItem',
|
|
|
|
components: { Item, AppLink },
|
|
|
|
components: {
|
|
|
|
|
|
|
|
Item,
|
|
|
|
|
|
|
|
AppLink
|
|
|
|
|
|
|
|
},
|
|
|
|
mixins: [FixiOSBug],
|
|
|
|
mixins: [FixiOSBug],
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
// route object
|
|
|
|
// route object
|
|
|
|
@ -75,7 +75,11 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
// Show parent if there are no child router to display
|
|
|
|
// Show parent if there are no child router to display
|
|
|
|
if (showingChildren.length === 0) {
|
|
|
|
if (showingChildren.length === 0) {
|
|
|
|
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true }
|
|
|
|
this.onlyOneChild = {
|
|
|
|
|
|
|
|
...parent,
|
|
|
|
|
|
|
|
path: '',
|
|
|
|
|
|
|
|
noShowingChildren: true
|
|
|
|
|
|
|
|
}
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,5 +95,10 @@ export default {
|
|
|
|
return path.resolve(this.basePath, routePath)
|
|
|
|
return path.resolve(this.basePath, routePath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
.el-submenu__title i {
|
|
|
|
|
|
|
|
color: #fff !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|