data() {return {fullHeight: document.documentElement.clientHeight, //页面高度
}
}mounted() {let _this = this if (window.outerHeight === screen.availHeight){if(window.outerWidth === screen.availWidth){this.isFullScreen = false}}else{this.isFullScreen = true}window.onresize = () => {return (() => {window.fullHeight = document.documentElement.clientHeightthis.fullHeight = window.fullHeight})()}},watch:{fullHeight(val){ //监听是否是全屏if (window.outerHeight === screen.availHeight){if(window.outerWidth === screen.availWidth){this.isFullScreen = false}}else{this.isFullScreen = true}}},
更多推荐
全屏,浏览器,项目,vue
发布评论