Browse Source

加ts类型

林旭祥 1 week ago
parent
commit
f0a4061694
1 changed files with 28 additions and 1 deletions
  1. 28 1
      src/components/SquareGame/index.vue

+ 28 - 1
src/components/SquareGame/index.vue

@@ -314,6 +314,12 @@ defineExpose({
 
 //背景
 class backgroundObj {
+  x:any;
+  y:any;
+  w:any;
+  h:any;
+  isLive:any;
+  num:any;
   constructor() {
     this.x = [];
     this.y = [];
@@ -402,6 +408,13 @@ class backgroundObj {
 
 //底下方块
 class squareObj {
+  num:any;
+  x:any;
+  y:any;
+  w:any;
+  h:any;
+  color:any;
+  isLive:any;
   constructor() {
     this.num = 12;
     this.x = [];
@@ -487,7 +500,7 @@ class squareObj {
 
   squareBorn() {
     const maxX = Math.max(
-      ...this.x.map((val, idx) => val + (this.w[idx] || 0))
+      ...this.x.map((val:any, idx:any) => val + (this.w[idx] || 0))
     );
     const maxI = this.x.indexOf(
       maxX - (this.w[this.x.indexOf(maxX)] || 0)
@@ -553,6 +566,13 @@ class squareObj {
 
 //我的方块
 class mySquareObj {
+  x:any;
+  y:any;
+  isLive:any;
+  l:any;
+  color:any;
+  toDownSpeed:any;
+  toVSpeed:any;
   constructor() {
     this.x;
     this.y;
@@ -641,6 +661,13 @@ class mySquareObj {
 
 //动画
 class beginAnimObj {
+  x:any;
+  y:any;
+  isLive:any;
+  l:any;
+  color:any;
+  toDownSpeed:any;
+  toVSpeed:any;
   constructor() {
     this.x;
     this.y;