diff --git a/CHANGELOG.md b/CHANGELOG.md index 91101cc..45cbafc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. See [standa ## Version 2026.10.14-it-tools-pro +### 🦶 功能页页脚固定在底部 + 修掉功能页的多余滚动条 +- **问题**:上一版页脚改为流内元素后,功能页出现**莫名其妙的滚动条** —— 实测根因是页脚在内容流内占位(`margin-top 40 + 高 41 = 81px`),把"内容刚好一屏"的功能页(内容高 848 / 可视 900)顶出 27px 溢出。实测 `/hash-text`:溢出 27px,**隐藏页脚后 = 0**,页脚是唯一成因 +- **改法**:给 `BaseLayout` 加 `fixedFooter` 开关,功能页(`tool.layout.vue` → ``)页脚 `position: fixed` 固定视口底部;首页等仍为流内最底部 + - `fixed` 态不再占文档流 → **`/hash-text` 等页面的多余滚动条消失**(溢出 27 → 0) + - 功能页内容底部补 `padding-bottom: 56px`,避免滚到底时页脚压住最后一块内容(实测余量 25px 起) +- **对齐修正**:固定页脚默认以**视口**为参照居中(720),而首页静态页脚居中于**内容区**(840,侧栏 240px),切换页面会横向跳动 120px → 给 `.content` 加 `transform: translateZ(0)` 建立包含块,使固定页脚也以内容区为参照;实测两边居中偏差均为 **0** +- **验证(20 个功能页全覆盖)**:`position: fixed` ✓、`padding-bottom: 56px` ✓、距视口底 12px ✓、居中偏差 0 ✓、单行 ✓、**滚到底无遮挡**(余量 25–477px)✓ + - 无多余滚动条:`/hash-text`、`/uuid-generator`、`/token-generator`、`/lorem-ipsum-generator`、`/color-converter`、`/date-converter`、`/chmod-calculator`、`/ulid-generator`、`/bip39-generator`、`/copywriting` 等 + - 内容本身超长的页面(`/emoji-picker` 24131px、`/base64-string-converter`、`/encryption`、`/ipv4-subnet-calculator`、`/label-designer`、`/ai-chat`、`/translator`、`/image-ocr`、`/pdf-ocr`、`/text-to-image`)保留滚动条(本就该有),且底部内容不被遮挡 + - 受控页试用浮条在顶部(top 70),与底部页脚**无冲突** ✓ + - 非功能页(`/`、`/about`、`/pricing`)仍为 `static` 流内最底部 ✓ + ### 🦶 页脚改为内容流最底部(取消固定) - **上一版**:`position: fixed` + `left:0; right:0; bottom:12` 贴住视口底部,**浮在内容之上** - **现在**:改为**常规流内元素**(`position: static`),排在页面内容**最末尾**,随内容滚动 diff --git a/src/components/MenuLayout.vue b/src/components/MenuLayout.vue index 84abf56..fb64d49 100644 --- a/src/components/MenuLayout.vue +++ b/src/components/MenuLayout.vue @@ -43,6 +43,10 @@ const siderPosition = computed(() => (isSmallScreen.value ? 'absolute' : 'static .content { // background-color: #f1f5f9; + // 建立包含块:让内容区内 position:fixed 的页脚以「内容区」为参照居中, + // 与首页(静态页脚,居中于内容区)保持一致,避免切换页面时页脚横向跳动 + transform: translateZ(0); + ::v-deep(.n-layout-scroll-container) { padding: 26px; } diff --git a/src/layouts/base.layout.vue b/src/layouts/base.layout.vue index 008342f..c7ec7dd 100644 --- a/src/layouts/base.layout.vue +++ b/src/layouts/base.layout.vue @@ -20,6 +20,9 @@ import UserMenu from '@/components/UserMenu.vue'; const themeVars = useThemeVars(); const styleStore = useStyleStore(); +// 页脚模式:默认随内容排在页面最底部(首页等);功能页传入 fixedFooter 改为固定在视口底部 +const props = withDefaults(defineProps<{ fixedFooter?: boolean }>(), { fixedFooter: false }); + // 已登录用户每次打开页面:自动拉取一次云端数据(收藏/记录/对话等跨设备恢复) const { syncNow, isLoggedIn } = useCloudSync(); if (isLoggedIn.value) { @@ -81,7 +84,7 @@ onBeforeUnmount(() => {