mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 13:28:38 +08:00
增加始终显示主侧边栏设置
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
'show': $store.state.settings.mode == 'mobile' && !$store.state.settings.sidebarCollapse
|
||||
}"
|
||||
>
|
||||
<div v-if="(!$store.state.settings.showHeader || $store.state.settings.mode == 'mobile') && $store.state.menu.routes.length > 1" class="main-sidebar-container">
|
||||
<div v-if="(!$store.state.settings.showHeader || $store.state.settings.mode == 'mobile') && ($store.state.menu.routes.length > 1 || $store.state.settings.alwaysShowMainSidebar)" class="main-sidebar-container">
|
||||
<Logo :show-title="false" class="sidebar-logo" />
|
||||
<div class="nav">
|
||||
<template v-for="(item, index) in $store.state.menu.routes">
|
||||
@@ -51,9 +51,9 @@
|
||||
'is-collapse': $store.state.settings.mode == 'pc' && $store.state.settings.sidebarCollapse
|
||||
}" @scroll="onSidebarScroll"
|
||||
>
|
||||
<Logo :show-logo="$store.state.menu.routes.length <= 1" :class="{
|
||||
<Logo :show-logo="$store.state.menu.routes.length <= 1 && !$store.state.settings.alwaysShowMainSidebar" :class="{
|
||||
'sidebar-logo': true,
|
||||
'sidebar-logo-bg': $store.state.menu.routes.length <= 1,
|
||||
'sidebar-logo-bg': $store.state.menu.routes.length <= 1 && !$store.state.settings.alwaysShowMainSidebar,
|
||||
'shadow': sidebarScrollTop
|
||||
}"
|
||||
/>
|
||||
@@ -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) {
|
||||
|
||||
@@ -9,6 +9,8 @@ let globalSettings = {
|
||||
openPermission: false,
|
||||
// 是否显示头部
|
||||
showHeader: false,
|
||||
// 是否始终显示主侧边栏,设置为 false 且主侧边栏里只有一个导航时,主侧边栏会自动隐藏
|
||||
alwaysShowMainSidebar: false,
|
||||
// 是否开启侧边栏展开收起按钮
|
||||
enableSidebarCollapse: false,
|
||||
// 侧边栏是否收起
|
||||
|
||||
Reference in New Issue
Block a user