mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
fix(hooks): [lockscreen] compatible with document non-existence (#18445)
This commit is contained in:
parent
27e0c496e8
commit
ef822ded7a
@ -48,6 +48,9 @@ export const useLockscreen = (
|
||||
|
||||
const cleanup = () => {
|
||||
setTimeout(() => {
|
||||
// When the test case is running, the context environment simulated by jsdom may have been destroyed,
|
||||
// and the document does not exist at this time.
|
||||
if (typeof document === 'undefined') return
|
||||
removeClass(document?.body, hiddenCls.value)
|
||||
if (withoutHiddenClass && document) {
|
||||
document.body.style.width = bodyWidth
|
||||
|
Loading…
Reference in New Issue
Block a user