vue 全屏简单方法 方便以后复制黏贴

data:

data() {
	 return {
		  fullscreen: false
	 };
},

js:

//全屏
fullScreen(){
	let element = document.documentElement;
	if (this.fullscreen) {
		if (document.exitFullscreen) {
			document.exitFullscreen();
		} else if (document.webkitCancelFullScreen) {
			document.webkitCancelFullScreen();
		} else if (document.mozCancelFullScreen) {
			document.mozCancelFullScreen();
		} else if (document.msExitFullscreen) {
			document.msExitFullscreen();
		}
	} else {
		if (element.requestFullscreen) {
			element.requestFullscreen();
		} else if (element.webkitRequestFullScreen) {
			element.webkitRequestFullScreen();
		} else if (element.mozRequestFullScreen) {
			element.mozRequestFullScreen();
		} else if (element.msRequestFullscreen) {
			// IE11
			element.msRequestFullscreen();
		}
	}
	this.fullscreen = !this.fullscreen;
},
上一篇:_BLOCK_TYPE_IS_VALID错误


下一篇:SetCooperativeLevel函数介绍(设置协作等级)