Skip to content

Document节点快捷方式属性中document.fullscreenElement属性的例子报错 #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yinenzhu opened this issue May 3, 2024 · 1 comment

Comments

@yinenzhu
Copy link

yinenzhu commented May 3, 2024

Document节点快捷方式属性中document.fullscreenElement属性的例子
if (document.fullscreenElement.nodeName == 'VIDEO') {
console.log('全屏播放视频');
}
好像有问题,报错提示 document.fullscreenElement is null。
在判断中加上?则不会报错,
if (document.fullscreenElement?.nodeName == 'VIDEO') {
console.log('全屏播放视频');
}

@ruanyf ruanyf closed this as completed in 2f55be8 May 4, 2024
@ruanyf
Copy link
Contributor

ruanyf commented May 4, 2024

谢谢指出,已经更正。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants