zhusiqing 5 жил өмнө
parent
commit
a69a5e1ff9

+ 4 - 0
src/components/Game.vue

@@ -36,6 +36,10 @@ export default {
   mounted() {
     const sumHeight = window.innerHeight
     this.height = `${Math.floor(sumHeight / 5)}px`
+    window.addEventListener('resize', () => {
+      const sumHeight = window.innerHeight
+      this.height = `${Math.floor(sumHeight / 5)}px`
+    })
   },
   beforeDestroy() {
     this.ws.close()