@@ -51,9 +51,9 @@
'is-collapse': $store.state.settings.mode == 'pc' && $store.state.settings.sidebarCollapse
}" @scroll="onSidebarScroll"
>
-
@@ -135,7 +135,7 @@ export default {
realSidebarWidth() {
let realSidebarWidth = 0
if (this.$store.state.settings.mode == 'pc') {
- if (!this.$store.state.settings.showHeader && this.$store.state.menu.routes.length > 1) {
+ if (!this.$store.state.settings.showHeader && (this.$store.state.menu.routes.length > 1 || this.$store.state.settings.alwaysShowMainSidebar)) {
realSidebarWidth = parseInt(variables.g_main_sidebar_width)
}
if (this.$store.state.settings.sidebarCollapse) {
diff --git a/src/setting.js b/src/setting.js
index 68222c79..d07b5c15 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -9,6 +9,8 @@ let globalSettings = {
openPermission: false,
// 是否显示头部
showHeader: false,
+ // 是否始终显示主侧边栏,设置为 false 且主侧边栏里只有一个导航时,主侧边栏会自动隐藏
+ alwaysShowMainSidebar: false,
// 是否开启侧边栏展开收起按钮
enableSidebarCollapse: false,
// 侧边栏是否收起