$App
11/8/26Less than 1 minute
Configuration
onAwake
Type:
function onAwake(time: number): void | Promise<void>;Parameters:
time: duration of this sleep, in ms
Called when the mini-program is brought back from the background.
Injected properties
Event dispatch
The event dispatch members are all instance properties or methods of $Emitter.
$on(type:string, handler: (event?:any) => void | Promise<void>): void: listen for thetypeevent$emit(type:string, event?:any): void: emit thetypeevent synchronously$emitAsync(type:string, event?:any): Promise<void>: emit thetypeevent asynchronously and accept a callback$off(type:string, handler?: (event?:any) => void | Promise<void>): void: remove thehandlerfortype, or all handlers whenhandleris omitted