diff --git a/packages/hooks/use-lockscreen/index.ts b/packages/hooks/use-lockscreen/index.ts index 41999acafd..d83e16f9d2 100644 --- a/packages/hooks/use-lockscreen/index.ts +++ b/packages/hooks/use-lockscreen/index.ts @@ -40,8 +40,8 @@ export const useLockscreen = (trigger: Ref) => { const cleanup = () => { setTimeout(() => { - removeClass(document.body, hiddenCls.value) - if (withoutHiddenClass) { + removeClass(document?.body, hiddenCls.value) + if (withoutHiddenClass && document) { document.body.style.width = bodyWidth } }, 200)