Class EntityBase

EntityBase.

Hierarchy (view full)

Implements

Constructors

Properties

_app?: App
_destroyed: boolean = false
data: ShallowReactive<{
    [key: string]: any;
}> = ...

Type declaration

  • [key: string]: any
extData: {
    [key: string]: any;
} = {}

Type declaration

  • [key: string]: any
instanceId: number = ++AppObject._instanceIdCounter
moduleManager: ModuleManager = ...
onSetApp: Signal = ...
uuid: string = ...

Accessors

  • get app(): App
  • Returns App

  • set app(value): void
  • Parameters

    Returns void

  • get destroyed(): boolean
  • Whether it has been destroyed.

    Returns boolean

Methods

  • 增加模块,如果模块已存在,则返回之前的模型,等同于this.addModule(xxx)

    Type Parameters

    Parameters

    • type: (new (entity?, obj?) => T)
        • new (entity?, obj?): T
        • Parameters

          • Optional entity: any
          • Optional obj: U

          Returns T

    • Optional params: U

    Returns T

  • 增加模块,如果模块已存在,则返回之前的模型,等同于this.add(xxx)

    Type Parameters

    Parameters

    • type: (new (entity?, obj?) => T)

      模块类

        • new (entity?, obj?): T
        • Parameters

          • Optional entity: any
          • Optional obj: U

          Returns T

    • Optional params: U

      参数

    Returns T

  • Parameters

    • toClassInst: any
    • Optional methodNames: string[]
    • Optional addMethods: string[]
    • Optional filterName: string[]

    Returns void

  • 调用模块中的函数

    Parameters

    • methodName: string
    • Rest ...args: any

    Returns void

  • 触发指定事件名称.

    Parameters

    • event: string

      Event name

    • Rest ...data: any

      Data

    Returns boolean

    • Whether the dispatching is successful
  • Parameters

    • fn: (() => any)
        • (): any
        • Returns any

    Returns void

  • 返回注册的所有事件名.

    Returns string[]

    所有事件名

  • 获取模块

    Type Parameters

    Parameters

    • type: (new (entity?, obj?) => T)

      模型类型

        • new (entity?, obj?): T
        • Parameters

          • Optional entity: any
          • Optional obj: U

          Returns T

    Returns T

  • 确定是否存在事件侦听

    Parameters

    • event: string

      事件名

    Returns boolean

    返回是否存在相应的事件

  • 返回具有指定事件名称的侦听总数.

    Parameters

    • event: string

      Event name

    Returns number

    The count of listeners

  • 移除监听.

    Parameters

    • event: string

      Event name

    • Optional fn: Function

      Function, If is undefined, delete all corresponding event listeners.

    Returns EventDispatcher

  • 通过事件名移除所有监听.

    Parameters

    • Optional event: string

      Event name, delete all events if not passed

    Returns void

  • 移除所有模块

    Returns void

  • 移除模块

    Type Parameters

    Parameters

    • type: (new (entity?, obj?) => T)

      模型类型

        • new (entity?, obj?): T
        • Parameters

          • Optional entity: any
          • Optional obj: U

          Returns T

    Returns void