James 4 лет назад
Родитель
Сommit
f6be90a4f5
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/App.vue

+ 7 - 0
src/App.vue

@@ -54,6 +54,13 @@
         sessionStorage.setItem("store", JSON.stringify(this.$store.state))
 
       })
+    },
+    mounted(){
+      window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize",function() {
+        if (window.orientation === 90 || window.orientation === -90) {
+          alert("横屏可能导致页面异常,建议竖屏操作");
+        }
+      },false);
     }
 
   }