报错内容为:
218:30 This expression is not callable.
Type 'Number' has no call signatures.
216 | let newY: number;
217 | newX = (this as any).x + Math.round((this as any).hasHorizontalScroll ? wheelDeltaX : 0)
> 218 | newY = (this as any).y + Math.round((this as any).hasVerticalScroll ? wheelDeltaY : 0)
218行Math报错了,谷歌了一圈未果
请问,因该怎么改正呢?
###你给newY定义成number类型,但是赋值的时候等号右边的表达式,使用的是any类型的变量进行计算,这样计算出的结果,不一定为number类型。
如果改的话,需要把y指定为number类型