Home > SYS_Window > addEventListener
SYS_Window.addEventListener() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
新增事件监听
Signature
typescript
addEventListener(type: ESYS_WindowEventType, listener: (ev: any) => any, options?: {
capture?: boolean;
once?: boolean;
passive?: boolean;
signal?: AbortSignal;
}): ISYS_WindowEventListenerRemovableObject | undefined;
1
2
3
4
5
6
2
3
4
5
6
Parameters
Parameter | Type | Description |
---|---|---|
type | 事件类型,当前支持 | |
listener | (ev: any) => any | 事件监听回调 |
options | { capture?: boolean; once?: boolean; passive?: boolean; signal?: AbortSignal; } | (Optional) 可选参数 |
Returns
ISYS_WindowEventListenerRemovableObject | undefined
事件监听方法,用于移除事件监听,如若为 undefined
则表示创建事件监听失败