- Add an action binding Configuration to the Component (nearly every Component offers the corresponding action binding options).
- Implement the action handling logic in the action panel.
Use Cases
Here is a simple example of event handling: Listen for a Button click event and pop up a dialog to display related information. To implement an event handling feature, the User needs to perform two steps:- Bind a User Action event to the Component. As shown below, we bind an
onClickevent to the Button Component. - Implement the corresponding event handling logic in the action panel. When the User clicks the Button, we pop up a dialog to display a greeting (
state.nameis a global variable we set, with an initial value of “Xiaoming”).