Explorar o código

unity的4个游戏不用限制竖屏

任一存 hai 1 ano
pai
achega
b3de83226f
Modificáronse 2 ficheiros con 7 adicións e 2 borrados
  1. 1 2
      game/README.md
  2. 6 0
      game/src/views/GameByUnity.vue

+ 1 - 2
game/README.md

@@ -10,5 +10,4 @@ https://sit-cnzhengquan.4dage.com/game/index.html#/
 
 ## 还缺资源:
 
-## todo
-unity的4个游戏不用限制竖屏,有适配PC宽屏任一存(任一存)
+## todo

+ 6 - 0
game/src/views/GameByUnity.vue

@@ -43,6 +43,7 @@ import { useRoute, useRouter } from "vue-router"
 import { useStore } from "vuex"
 import GameRule from '@/components/GameRule.vue'
 import NotifyBonusPointReachedLimit from '@/components/NotifyBonusPointReachedLimit.vue'
+import { onBeforeUnmount } from "vue"
 
 const route = useRoute()
 const router = useRouter()
@@ -109,6 +110,11 @@ if (store.state.ifScoreLimitReached) {
     isShowNotifyBonusPointReachedLimit.value = false
   }, 2000)
 }
+
+document.querySelector('#app > .top-wrapper').style.width = '100%'
+onBeforeUnmount(() => {
+  document.querySelector('#app > .top-wrapper').style.width = ''
+})
 </script>
 
 <style lang="less" scoped>