1. import screenfull from 'screenfull' mounted(){ this.screeninit() }, beforeDestroy() { this.destroyscreen() }, // 处理全屏 clickscreen() { if (!screenfull.isEnabled) { this.$message({ message: '你的浏览器不支持全屏', type: 'warning' }) return false } var a = document.getElementById('bigScreen') screenfull.toggle(a) }, changescreen() { this.isFullscreen = screenfull.isFullscreen }, screeninit() { if (screenfull.isEnabled) { screenfull.on('change', this.changescreen) } }, destroyscreen() { if (screenfull.isEnabled) { screenfull.off('change', this.changescreen) } },
标签:vue,isEnabled,destroyscreen,全屏,changescreen,screenfull,message From: https://www.cnblogs.com/panshuilong/p/17112179.html