Przeglądaj źródła

fix: backface-visibility兼容性问题,初始化数据为空的问题

zhusiqing 3 lat temu
rodzic
commit
8c360f391d
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      src/pages/Game/index.vue

+ 6 - 1
src/pages/Game/index.vue

@@ -96,7 +96,11 @@
   }
 
   const router = useRouter();
-  const playerNums = session.value.player;
+  let playerNums = session.value.player;
+  if (!playerNums) {
+    playerNums = 4;
+    router.replace('/login');
+  }
   const list = new Array(playerNums).fill(1).map((el, i) => {
     return {
       num: ++i,
@@ -310,6 +314,7 @@
             height: 100%;
             transition: transform 1s ease;
             backface-visibility: hidden;
+            -webkit-backface-visibility: hidden;
             background-color: @yellow;
             box-shadow: 2px 2px 10px 1px rgba(0, 0, 0, 0.2);
           }