Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-21 11:29:20 +08:00

fix: 修复 mobile + 非左侧布局模式时左侧导航菜单背景色异常的问题

This commit is contained in:
pany 2024-11-21 11:52:45 +08:00
parent 3155c086ca
commit 5f611b9a13

View File

@ -1,5 +1,6 @@
<script lang="ts" setup>
import { useDevice } from "@/hooks/useDevice"
import { useLayoutMode } from "@/hooks/useLayoutMode"
import { useAppStore } from "@/store/modules/app"
import { useSettingsStore } from "@/store/modules/settings"
import { storeToRefs } from "pinia"
@ -7,6 +8,7 @@ import { computed } from "vue"
import { AppMain, NavigationBar, Sidebar, TagsView } from "./components"
const { isMobile } = useDevice()
const { isLeft } = useLayoutMode()
const appStore = useAppStore()
const settingsStore = useSettingsStore()
const { showTagsView, fixedHeader } = storeToRefs(settingsStore)
@ -17,7 +19,8 @@ const layoutClasses = computed(() => {
hideSidebar: !appStore.sidebar.opened,
openSidebar: appStore.sidebar.opened,
withoutAnimation: appStore.sidebar.withoutAnimation,
mobile: isMobile.value
mobile: isMobile.value,
noLeft: !isLeft.value
}
})
@ -159,6 +162,12 @@ $transition-time: 0.35s;
transform: translate3d(calc(0px - var(--v3-sidebar-width)), 0, 0);
}
}
// mobile
&.noLeft {
.sidebar-container {
background-color: var(--el-bg-color);
}
}
}
.withoutAnimation {