diff --git a/pages/component/canvas/canvas/ball.uvue b/pages/component/canvas/canvas/ball.uvue index b60a53b398c230d0ed45f6922344ed09619fb48b..df16a2e5655a37ab4bc5b82d0bdde8855fee2639 100644 --- a/pages/component/canvas/canvas/ball.uvue +++ b/pages/component/canvas/canvas/ball.uvue @@ -39,7 +39,7 @@ this.vy = Math.abs(this.vy) return } - if (this.y > this.width - this.radius) { + if (this.y > this.height - this.radius) { this.vy = -Math.abs(this.vy) } } @@ -96,20 +96,20 @@ if (!this.runningFlag) { return } - this._animateResult = requestAnimationFrame((_: number) => { + this._animateResult = uni.requestAnimationFrame((_: number) => { this.animate() }) } start() { - cancelAnimationFrame(this._animateResult) + uni.cancelAnimationFrame(this._animateResult) this.runningFlag = true this.animate() } stop() { this.runningFlag = false - cancelAnimationFrame(this._animateResult) + uni.cancelAnimationFrame(this._animateResult) } }