相关文章推荐
想旅行的双杠  ·  Resource.Attribute.Tex ...·  1 年前    · 
淡定的李子  ·  在Bash ...·  1 年前    · 
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';