zhusiqing преди 5 години
родител
ревизия
a69a5e1ff9
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      src/components/Game.vue

+ 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()