Fixes bug

This commit is contained in:
Ah jung
2021-07-30 17:27:58 +08:00
parent 57245d21ee
commit 20da92aeab
3 changed files with 29 additions and 12 deletions

View File

@@ -226,7 +226,7 @@
function togNavTheme(theme) {
settingStore.navTheme = theme;
if (settingStore.navMode === 'horizontal' && theme === 'light') {
if (settingStore.navMode === 'horizontal' && ['light'].includes(theme)) {
settingStore.navTheme = 'dark';
}
}
@@ -237,11 +237,11 @@
function togNavMode(mode) {
settingStore.navMode = mode;
if (mode === 'horizontal') {
settingStore.setNavTheme('light');
} else {
settingStore.setNavTheme('dark');
}
// if (mode === 'header-dark') {
// settingStore.setNavTheme('dark');
// } else {
// settingStore.setNavTheme('light');
// }
}
return {

View File

@@ -1,8 +1,8 @@
<template>
<div class="layout-header" :class="{ 'layout-header-light': !(navTheme == 'header-dark') }">
<div class="layout-header">
<!--顶部菜单-->
<div class="layout-header-left" v-if="navMode === 'horizontal'">
<AsideMenu v-model:collapsed="collapsed" mode="horizontal" class="n-menu-horizontal-light" />
<AsideMenu v-model:collapsed="collapsed" :inverted="getInverted" mode="horizontal" />
</div>
<!--左侧菜单-->
<div class="layout-header-left" v-else>
@@ -131,6 +131,9 @@
collapsed: {
type: Boolean,
},
inverted: {
type: Boolean,
},
},
setup(props) {
const userStore = useUserStore();
@@ -153,6 +156,11 @@
crumbsSetting: getCrumbsSetting,
});
const getInverted = computed(() => {
const navTheme = unref(getNavTheme);
return ['light', 'header-dark'].includes(navTheme) ? props.inverted : !props.inverted;
});
const getChangeStyle = computed(() => {
const { collapsed } = props;
const { minMenuWidth, menuWidth }: any = unref(getMenuSetting);
@@ -305,6 +313,7 @@
reloadPage,
drawerSetting,
openSetting,
getInverted,
};
},
});
@@ -342,6 +351,10 @@
.n-breadcrumb {
display: inline-block;
}
&-menu {
color: var(--text-color);
}
}
&-right {