style: 菜单判断

This commit is contained in:
From-wh 2023-04-03 11:23:20 +08:00
parent 1fbac04381
commit 2310518099
2 changed files with 21 additions and 4 deletions

View File

@ -1,8 +1,8 @@
<template>
<el-aside class="layout-aside" :class="setCollapseWidth" v-if="clientWidth > 1000">
<Logo v-if="setShowLogo && menuList.length && $store.state.themeConfig.themeConfig.layout !== 'columns'" />
<Logo v-if="setShowLogo && menuList.length && getThemeConfig.layout !== 'columns'" />
<el-divider
v-if="menuList.length && !getThemeConfig.isCollapse && $store.state.themeConfig.themeConfig.layout == 'columns'"
v-if="menuList.length && !getThemeConfig.isCollapse && getThemeConfig.layout == 'columns'"
content-position="center"
>{{ catName }}</el-divider
>

View File

@ -10,14 +10,24 @@
<template v-for="val in menuList">
<el-submenu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
<template slot="title">
<Icon class="mr10" :type="val.icon ? val.icon : ''" />
<Icon
:class="
['defaults', 'classic'].includes(getThemeConfig.layout) && getThemeConfig.isCollapse ? 'center' : 'mr10'
"
:type="val.icon ? val.icon : ''"
/>
<span>{{ $t(val.title) }}</span>
</template>
<SubItem :chil="val.children" />
</el-submenu>
<template v-else>
<el-menu-item :index="val.path" :key="val.path">
<Icon class="mr10" :type="val.icon ? val.icon : ''" />
<Icon
:class="
['defaults', 'classic'].includes(getThemeConfig.layout) && getThemeConfig.isCollapse ? 'center' : 'mr10'
"
:type="val.icon ? val.icon : ''"
/>
<template slot="title" v-if="!val.isLink || (val.isLink && val.isIframe)">
<span>{{ $t(val.title) }}</span>
</template>
@ -74,3 +84,10 @@ export default {
},
};
</script>
<style scoped>
/deep/ .center {
text-align: center;
margin-right: 0 !important;
margin-left: 5px;
}
</style>