feat; 菜单背景色设置

This commit is contained in:
From-wh 2023-03-22 12:13:14 +08:00
parent ff8cc6dc82
commit f97a8e614b
5 changed files with 20 additions and 2 deletions

View File

@ -101,6 +101,7 @@ export default {
layout: {
configTitle: 'Layout configuration',
oneTitle: 'Global Themes',
menuBag: 'Menu BG Color',
twoTitle: 'Menu / top bar',
twoTopBar: 'Top bar background',
twoMenuBar: 'Menu background',

View File

@ -101,6 +101,7 @@ export default {
layout: {
configTitle: '布局配置',
oneTitle: '全局主题',
menuBag: '菜单背景色',
twoTitle: '菜单 / 顶栏',
twoTopBar: '顶栏背景',
twoMenuBar: '菜单背景',

View File

@ -101,6 +101,7 @@ export default {
layout: {
configTitle: '佈局配寘',
oneTitle: '全域主題',
menuBag: '菜單背景色',
twoTitle: '選單 / 頂欄',
twoTopBar: '頂欄背景',
twoMenuBar: '選單背景',

View File

@ -18,6 +18,13 @@
</el-color-picker>
</div>
</div>
<div class="layout-breadcrumb-seting-bar-flex">
<div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('message.layout.menuBag') }}</div>
<div class="layout-breadcrumb-seting-bar-flex-value">
<el-color-picker v-model="getThemeConfig.menuBgColor" size="small" @change="onMenuBgColorChange">
</el-color-picker>
</div>
</div>
<div class="layout-breadcrumb-seting-bar-flex mt15">
<div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('message.layout.fourIsDark') }}</div>
<div class="layout-breadcrumb-seting-bar-flex-value">
@ -333,6 +340,12 @@ export default {
}
this.setLocalThemeConfig();
},
onMenuBgColorChange() {
if (!this.getThemeConfig.menuBgColor) return;
// 颜色加深
document.documentElement.style.setProperty('--prev-bg-menuBar', this.getThemeConfig.menuBgColor);
this.setLocalThemeConfig();
},
// 深色模式
onAddDarkChange() {
const body = document.documentElement;

View File

@ -14,6 +14,8 @@ const themeConfigModule = {
*/
// 默认 primary 主题颜色
primary: '#409eff',
// 菜单背景色
menuBgColor: '#282c34',
// 是否开启深色模式
isIsDark: false,
@ -27,11 +29,11 @@ const themeConfigModule = {
// 默认顶栏导航字体颜色
topBarColor: '#606266',
// 默认菜单导航背景颜色
menuBar: '#545c64',
menuBar: '#282c34',
// 默认菜单导航字体颜色
menuBarColor: '#eaeaea',
// 默认分栏菜单背景颜色
columnsMenuBar: '#545c64',
columnsMenuBar: '#282c34',
// 默认分栏菜单字体颜色
columnsMenuBarColor: '#e6e6e6',