跳到主要内容

off 移除输入事件侦听器

off

类型: MethodDeclaration

定义位置: input.ts

描述

移除输入事件侦听器

参数 type: 输入事件类型

参数 listener: 回调函数

参数

参数名类型描述默认值
typeInputEventType--
listenerEventCallback--

返回值

类型: void

源代码

位置: 第 184 行

public off(type: InputEventType, listener: EventCallback): void {
const group = this.listeners[type]
const index = group.indexOf(listener)
if (index !== -1) {
const replacer = () => {}
group[index] = replacer
Callback.push(() => {
group.remove(replacer)
})
}
}

文档生成时间:2025/7/7 12:07:06