2023-12-31 23:33:05 +08:00
|
|
|
# Select
|
|
|
|
|
|
|
|
```rust demo
|
|
|
|
let value = create_rw_signal(None::<String>);
|
|
|
|
|
|
|
|
let options = vec![
|
|
|
|
SelectOption {
|
|
|
|
label: String::from("RwSignal"),
|
|
|
|
value: String::from("rw_signal"),
|
|
|
|
},
|
|
|
|
SelectOption {
|
|
|
|
label: String::from("Memo"),
|
|
|
|
value: String::from("memo"),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
view! {
|
|
|
|
<Select value options/>
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Select Props
|
|
|
|
|
|
|
|
| Name | Type | Default | Description |
|
|
|
|
| ------- | ----------------------------------- | -------------------- | ----------------------------------------- |
|
2024-02-09 22:44:22 +08:00
|
|
|
| class | `OptionalProp<MaybeSignal<String>>` | `Default::default()` | Addtional classes for the select element. |
|
|
|
|
| value | `Model<Option<T>>` | `None` | Checked value. |
|
2023-12-31 23:33:05 +08:00
|
|
|
| options | `MaybeSignal<Vec<SelectOption<T>>>` | `vec![]` | Options that can be selected. |
|