From 306a9c4fde94c54d91aee5a69d59b993c7c707a1 Mon Sep 17 00:00:00 2001 From: wangting <wangting@vci-tech.com> Date: 星期一, 30 十二月 2024 17:40:07 +0800 Subject: [PATCH] 调整菜单 --- Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue b/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue index c9cddc3..e6e5ba1 100644 --- a/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue +++ b/Source/plt-web/plt-web-ui/src/page/index/sidebar/sidebarItem.vue @@ -14,11 +14,12 @@ :key="item[labelKey]" :index="item[pathKey]"> <template slot="title"> - <div style="display: flex"> - <icon-show :name="item[iconKey]" class="iconShowSpan"></icon-show> - <span slot="title" - :class="{'el-menu--display':collapse && first}">{{ generateTitle(item) }}</span> - </div> + <div style="display: flex"> + <icon-show v-if="item[iconKey]" :name="item[iconKey]" class="iconShowSpan" :style="{ height: iconSize, width: iconSize }"></icon-show> + <i v-else class="el-icon-setting" :font-size="iconSize"></i> + <span slot="title" + :class="{'el-menu--display':collapse && first}">{{ generateTitle(item) }}</span> + </div> </template> <template v-for="(child,cindex) in item[childrenKey]"> <el-menu-item v-if="validatenull(child[childrenKey])" @@ -27,7 +28,8 @@ :index="child[pathKey],cindex" @click="open(child)"> <div style="display: flex"> - <icon-show :name="child[iconKey]" class="iconShowSpan"></icon-show> + <icon-show v-if="child[iconKey]" :name="child[iconKey]" class="iconShowSpan" :style="{ height: iconSize, width: iconSize }"></icon-show> + <i v-else class="el-icon-setting" :font-size="iconSize"></i> <span slot="title">{{ generateTitle(child) }}</span> </div> </el-menu-item> @@ -81,6 +83,9 @@ }, computed: { ...mapGetters(["roles"]), + iconSize() { + return this.collapse ? '20px' : '16px'; + }, labelKey() { return this.props.label || this.config.propsDefault.label; }, @@ -160,8 +165,6 @@ .iconShowSpan{ display: inline-block; margin-top: -2px; - width: 16px !important; - height: 16px !important; margin-right: 10px; color: #eeeeea; } -- Gitblit v1.9.3