<div @click="fullScreen">全屏显示</div> <div @click="exitFullScreen">退出全屏</div>
fullScreen () { var de = document.documentElement; if (de.requestFullscreen) { de.requestFullscreen(); } else if (de.mozRequestFullScreen) { de.mozRequestFullScreen(); } else if (de.webkitRequestFullScreen) { de.webkitRequestFullScreen(); } else if (de.msRequestFullscreen) { de.msRequestFullscreen(); } }, exitFullScreen () { var de = document; if (de.exitFullscreen) { de.exitFullscreen(); } else if (de.mozCancelFullScreen) { de.mozCancelFullScreen(); } else if (de.webkitCancelFullScreen) { de.webkitCancelFullScreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }
标签:msRequestFullscreen,网页,webkitCancelFullScreen,de,else,全屏,退出,document From: https://www.cnblogs.com/srqsl/p/18157058