API参考:Fullscreen API 全屏显示网页
['fullscreenchange','webkitfullscreenchange','mozfullscreenchange'].forEach((item,index) => {
window.addEventListener(item, () => this.fullscreenchange());
})
// 监听全屏事件触发
fullscreenchange() {
let isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
if (isFullScreen) {
// 进入全屏
} else {
// 退出全屏
}
},