Vue页面全屏以后,按下键盘Esc按键时,无法监听到Esc的按键事件,解决方案:
methods: {
	checkFull(){
		var isFull = document.fullscreenEnabled || window.fullScreen || document.webkitIsFullScreen || document.msFullscreenEnabled
		if(isFull === undefined) isFull = false;
        return isFull;
	}
},
created(){
	let that = this
	window.onresize = function(){
		if(!that.checkFull()){
			// 退出全屏后要执行的动作
			that.$emit('Fullscreen',false)
		}
	}
}
Logo

前往低代码交流专区

更多推荐