[][src]Module yew::components::select

This module contains implementation of Select component. You can use it instead <select> tag, because the component helps you to track selected value in an original type. Example:

#[derive(PartialEq, Clone)]
enum Scene {
    First,
    Second,
}
impl ToString for Scene {
    fn to_string(&self) -> String {
        match self {
            Scene::First => "First".to_string(),
            Scene::Second => "Second".to_string()
        }
    }
}

fn view(link: ComponentLink<Model>) -> Html {
    let scenes = vec![Scene::First, Scene::Second];
    html! {
        <Select<Scene> options=scenes onchange=link.callback(|_| ()) />
    }
}

Structs

Props

Properties of Select component.

Select

Select component.

Enums

Msg

Internal message of the component.