let XX = (this.bodies[i-1] as HTMLElement).offsetLeft
let YY = (this.bodies[i-1] as HTMLElement).offsetTop
// 将值设置为当前身体上
(this.bodies[i] as HTMLElement).style.left = XX + 'px'
(this.bodies[i] as HTMLElement).style.top = YY + 'px'
解决方案:
在每一个后面加上 ;
let XX = (this.bodies[i-1] as HTMLElement).offsetLeft;
let YY = (this.bodies[i-1] as HTMLElement).offsetTop;
// 将值设置为当前身体上
(this.bodies[i] as HTMLElement).style.left = XX + 'px';
(this.bodies[i] as HTMLElement).style.top = YY + 'px';