zhusiqing 5 жил өмнө
parent
commit
91431ad0b0

+ 7 - 3
src/components/Game.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="game">
     <div class="prevserve">
-      <div class="item" v-for="(el ,i) in list" :key="i" >
+      <div class="item" :style="{ height: height }" v-for="(el ,i) in list" :key="i" >
         <Card
           :card="el"
           :index="i"
@@ -26,12 +26,17 @@ export default {
       list: [],
       isCaptain: false,
       code: '',
-      ws: null
+      ws: null,
+      height: '20vh'
     }
   },
   created() {
     this.init()
   },
+  mounted() {
+    const sumHeight = window.innerHeight
+    this.height = `${Math.floor(sumHeight / 5)}px`
+  },
   beforeDestroy() {
     this.ws.close()
   },
@@ -100,7 +105,6 @@ export default {
   }
   .item {
     width: 20vw;
-    height: 20vh;
   }
 }