+
diff --git a/src/layouts/components/NavigationBar/index.vue b/src/layouts/components/NavigationBar/index.vue
index 77c16103..85435498 100644
--- a/src/layouts/components/NavigationBar/index.vue
+++ b/src/layouts/components/NavigationBar/index.vue
@@ -1,5 +1,4 @@
-
+
@@ -23,13 +17,17 @@ const isLeftTop = computed(() => layoutMode.value === "left-top")
-
+
-
+
diff --git a/src/layouts/components/Settings/index.vue b/src/layouts/components/Settings/index.vue
index 6fe47bd9..0f060bad 100644
--- a/src/layouts/components/Settings/index.vue
+++ b/src/layouts/components/Settings/index.vue
@@ -2,15 +2,16 @@
import { watchEffect } from "vue"
import { storeToRefs } from "pinia"
import { useSettingsStore } from "@/store/modules/settings"
+import { useLayoutMode } from "@/hooks/useLayoutMode"
import { resetConfigLayout } from "@/utils"
import SelectLayoutMode from "./SelectLayoutMode.vue"
import { Refresh } from "@element-plus/icons-vue"
+const { isLeft } = useLayoutMode()
const settingsStore = useSettingsStore()
/** 使用 storeToRefs 将提取的属性保持其响应性 */
const {
- layoutMode,
showTagsView,
showLogo,
fixedHeader,
@@ -43,7 +44,7 @@ const switchSettings = {
/** 非左侧模式时,Header 都是 fixed 布局 */
watchEffect(() => {
- layoutMode.value !== "left" && (fixedHeader.value = true)
+ isLeft.value && (fixedHeader.value = true)
})
@@ -55,7 +56,7 @@ watchEffect(() => {
功能配置
{{ settingName }}
-
+
重 置
diff --git a/src/layouts/components/Sidebar/index.vue b/src/layouts/components/Sidebar/index.vue
index bcba44cf..329f9eb2 100644
--- a/src/layouts/components/Sidebar/index.vue
+++ b/src/layouts/components/Sidebar/index.vue
@@ -1,13 +1,13 @@
diff --git a/src/layouts/index.vue b/src/layouts/index.vue
index c31fca65..fb2712da 100644
--- a/src/layouts/index.vue
+++ b/src/layouts/index.vue
@@ -5,6 +5,7 @@ import { useSettingsStore } from "@/store/modules/settings"
import useResize from "./hooks/useResize"
import { useWatermark } from "@/hooks/useWatermark"
import { useDevice } from "@/hooks/useDevice"
+import { useLayoutMode } from "@/hooks/useLayoutMode"
import LeftMode from "./LeftMode.vue"
import TopMode from "./TopMode.vue"
import LeftTopMode from "./LeftTopMode.vue"
@@ -16,9 +17,9 @@ useResize()
const { setWatermark, clearWatermark } = useWatermark()
const { isMobile } = useDevice()
+const { isLeft, isTop, isLeftTop } = useLayoutMode()
const settingsStore = useSettingsStore()
-const { showSettings, layoutMode, showTagsView, showWatermark, showGreyMode, showColorWeakness } =
- storeToRefs(settingsStore)
+const { showSettings, showTagsView, showWatermark, showGreyMode, showColorWeakness } = storeToRefs(settingsStore)
const classes = computed(() => {
return {
@@ -46,11 +47,11 @@ watchEffect(() => {
-
+
-
+
-
+