Ver Fonte

全屏事件优化-还存在bug

gcz há 2 anos atrás
pai
commit
0a8b48eedd
1 ficheiros alterados com 11 adições e 1 exclusões
  1. 11 1
      src/components/header.vue

+ 11 - 1
src/components/header.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2022-06-14 18:11:54
  * @LastEditors: gcz
- * @LastEditTime: 2022-07-01 09:45:10
+ * @LastEditTime: 2022-07-14 17:58:27
  * @FilePath: \castgroup_bigscreen\src\components\header.vue
  * @Copyright: Copyright (c) 2016~2022 by wangcc, All Rights Reserved. 
 -->
@@ -39,6 +39,15 @@ import timeFormat from '@/utils/timeFormat'
             }, 1000);
         },
         mounted(){
+            window.onresize = () =>{
+                let clientHeight = document.documentElement.clientHeight;
+                let windowHeight = window.screen.height;
+                if(clientHeight==windowHeight){
+                    this.isFull=true
+                }else{
+                    this.isFull=false
+                }
+            };
             window.WIDGET = {
             CONFIG: {
                 modules: '01234',
@@ -69,6 +78,7 @@ import timeFormat from '@/utils/timeFormat'
         },
         methods: {
             toggleFullScreen(){
+                console.log('document.documentElement.requestFullscreen',document.documentElement.requestFullscreen);
                 // alternative standard method
                 if (!document.fullscreenElement &&
                     !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { // current working methods