Преглед изворни кода

分享页面 在app中 竖屏

黄琪勇 пре 10 месеци
родитељ
комит
e5801c1462
1 измењених фајлова са 13 додато и 2 уклоњено
  1. 13 2
      src/views/creation/index-share.tsx

+ 13 - 2
src/views/creation/index-share.tsx

@@ -5,7 +5,8 @@ import {
   reactive,
   ref,
   watch,
-  nextTick
+  nextTick,
+  onBeforeMount
 } from 'vue';
 // import WaveSurfer from 'wavesurfer.js';
 // import Regions from 'wavesurfer.js/dist/plugins/regions.js';
@@ -538,8 +539,18 @@ export default defineComponent({
     function setFullHeight(){
       creationHeight.value = window.innerHeight
     }
+    onBeforeMount(() => {
+      if(isApp) {
+        postMessage({
+          api: "setRequestedOrientation",
+          content: {
+            orientation: 1,
+          },
+        });
+        setStatusBarTextColor(true)
+      }
+    })
     onMounted(async () => {
-      if(isApp) { setStatusBarTextColor(true) }
       __init();
       setFullHeight()
       window.addEventListener('resize', setFullHeight)