Explorar o código

处理进入游戏横屏没有画面问题

leo hai 9 meses
pai
achega
aba514f1e7
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  1. 6 5
      static/rtcEngine/js/WXtrialInterface.js

+ 6 - 5
static/rtcEngine/js/WXtrialInterface.js

@@ -137,7 +137,6 @@ const app = new Vue({
             let obj = {
                 objectFit: "fill"
             }
-
             if (this.isLandscape) {
                 obj = {
                     width: `${this.layoutViewHeight}px`,
@@ -732,10 +731,12 @@ const app = new Vue({
             // 高度、悬浮球相关配置
             this.height = window.innerHeight
             this.width = window.innerWidth
-            // 云机画面宽高
-            let layoutView = document.querySelector('.layout-view')
-            this.layoutViewWidth = layoutView.offsetWidth
-            this.layoutViewHeight = layoutView.offsetHeight
+            this.$nextTick(() => {
+                // 云机画面宽高
+                let layoutView = document.querySelector('.layout-view')
+                this.layoutViewWidth = layoutView.offsetWidth
+                this.layoutViewHeight = layoutView.offsetHeight
+            })
         }
     }
 })