Class EventDispatcher

支持事件处理和自定义数据

Hierarchy (view full)

Constructors

Properties

_listeners: {} = {}

Methods

  • 添加事件监听机器

    Parameters

    • type: string
    • listener: any

    Returns void

  • Parameters

    • type: string
    • listener: any

    Returns boolean

  • 移除事件监听器

    Parameters

    • type: string
    • listener: any

    Returns void

  • Protected

    触发事件。

    Parameters

    • event: any

      event.type event.target 如果未指定,自动设置为当前对象

    Returns void

  • 指定自定义数据

    Parameters

    • key: string
    • value: any

    Returns void

  • 获取某个自定义数据

    Parameters

    • key: string

    Returns any