__AddEvent
Introduction
Adds an Event Listener to the Element object.
Syntax
Parameters
- When the listener is a case-sensitive string, upon triggering the listened event, the Lynx SDK will send the current Element's
parentComponentUniqueID,listener, andeventto the background thread. - When the listener is null or undefined, the Lynx SDK will remove the corresponding listener for the specified type and name from the Element object.
Note
Due to limitations of the Lynx SDK, currently, only one listener can be added for the same type and name. Adding a listener with the same type and name again will overwrite the previously added listener.
Return Value
No return value.
Example
The frontend framework can generate render directives in the following way.