refactor(composables): 移除未使用的 Lenis 类型导入并优化 useHead 配置
移除未使用的 Lenis 类型导入以简化代码 在 htmlAttrs 中添加 lang 属性配置
This commit is contained in:
@@ -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> | 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
|
||||
|
||||
Reference in New Issue
Block a user