From bb7e2c04c8856b19ec6888cc7de64524d11de350 Mon Sep 17 00:00:00 2001 From: chenchun Date: Mon, 27 Apr 2026 15:41:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(composables):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=20Lenis=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AF=BC=E5=85=A5=E5=B9=B6=E4=BC=98=E5=8C=96=20useHea?= =?UTF-8?q?d=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除未使用的 Lenis 类型导入以简化代码 在 htmlAttrs 中添加 lang 属性配置 --- app/composables/usePageScrollLock.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/composables/usePageScrollLock.ts b/app/composables/usePageScrollLock.ts index 2b5dea2..6d79dfe 100644 --- a/app/composables/usePageScrollLock.ts +++ b/app/composables/usePageScrollLock.ts @@ -1,6 +1,5 @@ import { onBeforeUnmount, watch, type Ref, isRef, unref, computed } from 'vue' import { useNuxtApp, useHead } from '#imports' -import type Lenis from 'lenis' // 全局模块级变量,用于记录锁定请求的次数,解决多组件并发锁定的竞态问题 let lenisLockCount = 0 @@ -13,8 +12,9 @@ export const usePageScrollLock = (isLocked: Ref | boolean) => { // SSR 和 CSR 都支持:自动将 class 注入到 HTML 标签上 useHead({ htmlAttrs: { - class: computed(() => unref(isLocked) ? 'is-home-intro-active' : '') - } + class: computed(() => unref(isLocked) ? 'is-home-intro-active' : ''), + lang: 'zh-CN', + }, }) let currentlyLocked = false