Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Event

所有事件对象的基类,包含事件相关基本信息。

Hierarchy

Index

Constructors

constructor

  • newEvent(type: string, bubbles?: undefined | false | true): Event
  • Parameters

    • type: string

      The name of the event (case-sensitive), e.g. "click", "fire", or "submit"

    • Optional bubbles: undefined | false | true

      A boolean indicating whether the event bubbles up through the tree or not

    Returns Event

Properties

bubbles

bubbles: boolean

表示该事件是否进行冒泡。

currentTarget

currentTarget: Object | null = null

当前目标。

eventPhase

eventPhase: number = 0

事件阶段。

propagationImmediateStopped

propagationImmediateStopped: boolean = false

立即停止当前事件的传递,事件甚至不会被分派到所连接的当前目标。

propagationStopped

propagationStopped: boolean = false

停止传递当前事件。

target

target: Object | null = null

最初事件触发的目标。

type

type: string

事件类型。

Static ACCELERATION

ACCELERATION: string = "acceleration"

加速器事件类型。

Static AT_TARGET

AT_TARGET: number = 2

目标阶段仅包括事件目标节点。

Static BUBBLING_PHASE

BUBBLING_PHASE: number = 3

冒泡阶段, 包括回程遇到到层次根节点的任何后续节点。

Static CAPTURING_PHASE

CAPTURING_PHASE: number = 1

捕获阶段,包括事件目标节点之前从根节点到最后一个节点的过程。

Static KEYBOARD

KEYBOARD: string = "keyboard"

键盘事件类型。

Static MOUSE

MOUSE: string = "mouse"

鼠标事件类型。

Static NONE

NONE: number = 0

尚未派发事件阶段。

Static NO_TYPE

NO_TYPE: string = "no_type"

没有类型的事件。

Static TOUCH

TOUCH: string = "touch"

触摸事件类型。

Methods

getCurrentTarget

  • getCurrentTarget(): null | Object

getType

  • getType(): string

isStopped

  • isStopped(): boolean

reuse

  • reuse(type: string, bubbles?: undefined | false | true): void
  • 重新初始化让对象池中取出的事件可再次使用。

    Parameters

    • type: string

      The name of the event (case-sensitive), e.g. "click", "fire", or "submit"

    • Optional bubbles: undefined | false | true

      A boolean indicating whether the event bubbles up through the tree or not

    Returns void

unuse

  • unuse(): void

Generated using TypeDoc