左侧菜单New标记新增可配置

This commit is contained in:
不做码农 2023-09-08 18:30:00 +08:00
parent 740061502e
commit 05fdc8d4a2
2 changed files with 17 additions and 5 deletions

View File

@ -9,7 +9,11 @@
<template #title> <template #title>
<span v-if="onlyOneChild.meta.titleKey">{{ $t(onlyOneChild.meta.titleKey) }}</span> <span v-if="onlyOneChild.meta.titleKey">{{ $t(onlyOneChild.meta.titleKey) }}</span>
<span v-else-if="onlyOneChild.meta.title">{{ onlyOneChild.meta.title }}</span> <span v-else-if="onlyOneChild.meta.title">{{ onlyOneChild.meta.title }}</span>
<svg-icon name="new" color="#fff" style="width: 50px; height: 25px" v-if="onlyOneChild.meta.title && onlyOneChild.meta.isNew == 1" /> <svg-icon
name="new"
color="#fff"
style="width: 50px; height: 25px"
v-if="onlyOneChild.meta.title && onlyOneChild.meta.isNew == 1 && defaultSettings.menuShowNew" />
</template> </template>
</el-menu-item> </el-menu-item>
</app-link> </app-link>
@ -20,7 +24,11 @@
<svg-icon :name="item.meta && item.meta.icon" /> <svg-icon :name="item.meta && item.meta.icon" />
<span v-if="item.meta && item.meta.titleKey">{{ $t(item.meta.titleKey) }}</span> <span v-if="item.meta && item.meta.titleKey">{{ $t(item.meta.titleKey) }}</span>
<span v-else-if="item.meta && item.meta.title">{{ item.meta.title }}</span> <span v-else-if="item.meta && item.meta.title">{{ item.meta.title }}</span>
<svg-icon name="new" color="#fff" style="width: 50px; height: 25px" v-if="item.meta.title && item.meta.isNew == 1" /> <svg-icon
name="new"
color="#fff"
style="width: 50px; height: 25px"
v-if="item.meta.title && item.meta.isNew == 1 && defaultSettings.menuShowNew" />
</template> </template>
<sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child" :base-path="resolvePath(child.path)" /> <sidebar-item v-for="child in item.children" :key="child.path" :is-nest="true" :item="child" :base-path="resolvePath(child.path)" />
@ -32,7 +40,7 @@
import { isExternal } from '@/utils/validate' import { isExternal } from '@/utils/validate'
import AppLink from './Link' import AppLink from './Link'
import { getNormalPath } from '@/utils/ruoyi' import { getNormalPath } from '@/utils/ruoyi'
import defaultSettings from '@/settings'
const props = defineProps({ const props = defineProps({
// route object // route object
item: { item: {

View File

@ -14,7 +14,7 @@ export default {
/** /**
* 框架主题颜色值 * 框架主题颜色值
*/ */
theme: '#FF8C00', theme: '#409EFF',
/** /**
* 是否系统布局配置 * 是否系统布局配置
*/ */
@ -79,5 +79,9 @@ export default {
/** /**
* 默认语言 * 默认语言
*/ */
defaultLang: 'zh-cn' defaultLang: 'zh-cn',
/**
* 左侧菜单是否显示New标记
*/
menuShowNew: false
} }