event

Attribute Macro event 

Source
#[event]
Expand description

Attribute macro for marking event emitters.

Events allow components to communicate with their parents.

§Example

#[derive(Component)]
struct Button {
    #[event]
    on_click: EventEmitter<()>,

    #[event]
    on_value_change: EventEmitter<String>,
}