English
emitEvent(eventName, opt)
About 107 wordsLess than 1 minute
2025-09-22
Sends an event for internal plugin communication. Use it together with onEvent.
Parameters
| Parameter | Description | Type |
|---|---|---|
| eventName | Event name | String |
| opt | Custom parameters of the event | Object |
Return Value
None
Code Example
export default function (context) {
return {
/** After the create/edit page has finished rendering */
renderEnd(){
// Listen to the formRenderEnd event
context.onEvent("formRenderEnd",opt=>{
console.log("context.onEvent formRenderEnd", opt);//opt={test:1}
})
// Send the formRenderEnd event
context.emitEvent("formRenderEnd", {test:1});
}
}
}Notes
- The emitted event can only be listened to by the
onEventmethod of thecontextobject within the lifecycle of the current create/edit page.
