From a57e03f7cb03c1ba5f2f2b4c5d7a06b0ed1d0ecb Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 09 四月 2026 11:42:26 +0800
Subject: [PATCH] fix: 添加APP版本管理
---
src/layout/index.vue | 75 +++++++++++++++++--------------------
1 files changed, 34 insertions(+), 41 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index b81b4b3..2d4bf01 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -3,15 +3,13 @@
<div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
<sidebar v-if="!sidebar.hide" class="sidebar-container" />
<div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container">
- <el-scrollbar>
- <div :class="{ 'fixed-header': fixedHeader }">
- <navbar @setLayout="setLayout" />
- <tags-view v-if="needTagsView" />
- </div>
- <app-main />
- <settings ref="settingRef" />
- </el-scrollbar>
- </div>
+ <div :class="{ 'fixed-header': fixedHeader }">
+ <navbar @setLayout="setLayout" />
+ <tags-view v-if="needTagsView" />
+ </div>
+ <app-main />
+ <settings ref="settingRef" />
+ </div>
</div>
</template>
@@ -25,12 +23,12 @@
import useSettingsStore from '@/store/modules/settings'
const settingsStore = useSettingsStore()
-const theme = computed(() => settingsStore.theme);
-const sideTheme = computed(() => settingsStore.sideTheme);
-const sidebar = computed(() => useAppStore().sidebar);
-const device = computed(() => useAppStore().device);
-const needTagsView = computed(() => settingsStore.tagsView);
-const fixedHeader = computed(() => settingsStore.fixedHeader);
+const theme = computed(() => settingsStore.theme)
+const sideTheme = computed(() => settingsStore.sideTheme)
+const sidebar = computed(() => useAppStore().sidebar)
+const device = computed(() => useAppStore().device)
+const needTagsView = computed(() => settingsStore.tagsView)
+const fixedHeader = computed(() => settingsStore.fixedHeader)
const classObj = computed(() => ({
hideSidebar: !sidebar.value.opened,
@@ -39,13 +37,16 @@
mobile: device.value === 'mobile'
}))
-const { width, height } = useWindowSize();
-const WIDTH = 992; // refer to Bootstrap's responsive design
+const { width, height } = useWindowSize()
+const WIDTH = 992 // refer to Bootstrap's responsive design
-watchEffect(() => {
+watch(() => device.value, () => {
if (device.value === 'mobile' && sidebar.value.opened) {
useAppStore().closeSideBar({ withoutAnimation: false })
}
+})
+
+watchEffect(() => {
if (width.value - 1 < WIDTH) {
useAppStore().toggleDevice('mobile')
useAppStore().closeSideBar({ withoutAnimation: true })
@@ -58,9 +59,9 @@
useAppStore().closeSideBar({ withoutAnimation: false })
}
-const settingRef = ref(null);
+const settingRef = ref(null)
function setLayout() {
- settingRef.value.openSetting();
+ settingRef.value.openSetting()
}
</script>
@@ -73,18 +74,9 @@
position: relative;
height: 100%;
width: 100%;
-
- .el-scrollbar {
- height: 100%;
- }
-
- :deep(.el-scrollbar__bar).is-vertical {
- z-index: 10;
- }
-
- :deep(.el-scrollbar__wrap) {
- overflow-x: hidden;
- }
+ background:
+ radial-gradient(circle at top, rgba(223, 232, 226, 0.95), transparent 32%),
+ linear-gradient(180deg, #f7faf8 0%, var(--app-bg) 100%);
&.mobile.openSidebar {
position: fixed;
@@ -104,22 +96,23 @@
.fixed-header {
position: fixed;
- top: 0;
- right: 0;
+ top: 12px;
+ right: 16px;
z-index: 9;
- width: calc(100% - #{$base-sidebar-width});
- transition: width 0.28s;
+ width: calc(100% - #{$base-sidebar-width} - 32px);
+ transition: width 0.28s, right 0.28s;
+ padding-bottom: 8px;
}
-.hideSidebar .fixed-header {
- width: calc(100% - 54px);
-}
+.hideSidebar .fixed-header {
+ width: calc(100% - 100px);
+}
.sidebarHide .fixed-header {
- width: 100%;
+ width: calc(100% - 32px);
}
.mobile .fixed-header {
width: 100%;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3