代码微调

This commit is contained in:
hooray 2021-12-11 11:23:06 +08:00
parent 63a1e7f299
commit 9e91f4f13e
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@
<div class="nav">
<template v-for="(item, index) in $store.getters['menu/routes']">
<div v-if="item.children && item.children.length !== 0" :key="index" class="item" :class="{'active': index == $store.state.menu.headerActived}" @click="switchMenu(index)">
<svg-icon v-if="item.meta.icon" :name="item.meta.icon" class="icon" />
<svg-icon v-if="item.meta.icon" :name="item.meta.icon" />
<span v-if="item.meta.title">{{ item.meta.title }}</span>
</div>
</template>
@ -104,7 +104,7 @@ header {
color: $g-header-menu-active-color;
background-color: $g-header-menu-active-bg;
}
.icon {
.svg-icon {
font-size: 24px;
vertical-align: middle;
& + span {

View File

@ -11,7 +11,7 @@
'active': index === $store.state.menu.headerActived
}" :title="item.meta.title" @click="switchMenu(index)"
>
<svg-icon v-if="item.meta.icon" :name="item.meta.icon" class="icon" />
<svg-icon v-if="item.meta.icon" :name="item.meta.icon" />
<span>{{ item.meta.title }}</span>
</div>
</template>
@ -75,7 +75,7 @@ const switchMenu = inject('switchMenu')
color: $g-main-sidebar-menu-active-color;
background-color: $g-main-sidebar-menu-active-bg;
}
.icon {
.svg-icon {
margin: 0 auto;
font-size: 24px;
}