Skip to content

Commit 5f611b9

Browse files
committed
fix: 修复 mobile + 非左侧布局模式时左侧导航菜单背景色异常的问题
1 parent 3155c08 commit 5f611b9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/layouts/LeftMode.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<script lang="ts" setup>
22
import { useDevice } from "@/hooks/useDevice"
3+
import { useLayoutMode } from "@/hooks/useLayoutMode"
34
import { useAppStore } from "@/store/modules/app"
45
import { useSettingsStore } from "@/store/modules/settings"
56
import { storeToRefs } from "pinia"
67
import { computed } from "vue"
78
import { AppMain, NavigationBar, Sidebar, TagsView } from "./components"
89
910
const { isMobile } = useDevice()
11+
const { isLeft } = useLayoutMode()
1012
const appStore = useAppStore()
1113
const settingsStore = useSettingsStore()
1214
const { showTagsView, fixedHeader } = storeToRefs(settingsStore)
@@ -17,7 +19,8 @@ const layoutClasses = computed(() => {
1719
hideSidebar: !appStore.sidebar.opened,
1820
openSidebar: appStore.sidebar.opened,
1921
withoutAnimation: appStore.sidebar.withoutAnimation,
20-
mobile: isMobile.value
22+
mobile: isMobile.value,
23+
noLeft: !isLeft.value
2124
}
2225
})
2326
@@ -159,6 +162,12 @@ $transition-time: 0.35s;
159162
transform: translate3d(calc(0px - var(--v3-sidebar-width)), 0, 0);
160163
}
161164
}
165+
// 即是 mobile 又是顶部或混合布局模式
166+
&.noLeft {
167+
.sidebar-container {
168+
background-color: var(--el-bg-color);
169+
}
170+
}
162171
}
163172
164173
.withoutAnimation {

0 commit comments

Comments
 (0)