From bf131bd7028003b01ff079cd30c432059cb6a841 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期五, 24 一月 2025 16:44:20 +0800
Subject: [PATCH] 34
---
src/App.vue | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index 7fe1997..026a1fa 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,7 +1,17 @@
<script setup lang="ts">
-import { ref } from "vue";
+import { onMounted,onUnmounted } from "vue";
import deviceView from "./components/deviceView.vue";
-
+onMounted(()=>{
+ console.log(window.plus)
+ if (window.plus) {
+ plus.screen.lockOrientation('landscape'); // 锁定横屏
+ }
+})
+onUnmounted(()=>{
+ if (window.plus) {
+ plus.screen.unlockOrientation(); // 解锁屏幕方向
+ }
+})
</script>
<template>
--
Gitblit v1.8.0