声明参数类型e:MouseEvent时eslint报错

声明参数类型e:MouseEvent时eslint报错

代码如下:

dom.addEventListener('mousedown', (e: MouseEvent) => {

console.log(e.clientX);

})

报错信息如下:
No overload matches this call.
Overload 1 of 2, '(type: keyof ElementEventMap, listener: (this: Element, ev: Event) => any, options?: boolean | AddEventListenerOptions | undefined): void | undefined', gave the following error.
Overload 2 of 2, '(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void | undefined', gave the following error.

以上是 声明参数类型e:MouseEvent时eslint报错 的全部内容, 来源链接: utcz.com/p/937465.html

回到顶部