Events


This feature allows you to listen to some components and/or HTML elements for events, to trigger some actions inside the original component.

Events can be called within components inside a page.

1. Choose your original component, the one that needs to change after the event is fired

select cmp event fouita

2. Choose your target, where the event will be fired

pick target event fouita

Notice that the Xpath used to select the switch component ends with @opuid='0xa046'
In that case we can use custom events triggered by the component

dispatch event fouita


3. Choose the event that will be fired


event code fouita


Since the original component "PricingCard" has "yearly" property exported, we can change it using the result sent from "SwitchButton" component.

props refer to the original component props, any update will affect the component selected from the page.
evt refer to the data sent from the component that fired the event (the one we picked with xpath)

Note that target components set by an xpath that does not end with /[@opuid="CMP_UID"] won't be able to use custom events.