mirror of
https://github.com/adoyle0/thaw.git
synced 2025-01-22 22:09:22 -05:00
feat: Checkbox children can be empty
This commit is contained in:
parent
b44ba4f143
commit
40e0e51444
2 changed files with 5 additions and 2 deletions
|
@ -5,6 +5,7 @@ let value = create_rw_signal(false);
|
|||
|
||||
view! {
|
||||
<Checkbox value>"Click"</Checkbox>
|
||||
<Checkbox />
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use leptos::*;
|
|||
pub fn Checkbox(
|
||||
#[prop(optional, into)] value: Model<bool>,
|
||||
#[prop(optional, into)] class: MaybeSignal<String>,
|
||||
children: Children,
|
||||
#[prop(optional)] children: Option<Children>,
|
||||
) -> impl IntoView {
|
||||
let theme = use_theme(Theme::light);
|
||||
mount_style("checkbox", include_str!("./checkbox.css"));
|
||||
|
@ -50,7 +50,9 @@ pub fn Checkbox(
|
|||
</Then>
|
||||
</If>
|
||||
</div>
|
||||
<div class="thaw-checkbox__label">{children()}</div>
|
||||
<OptionComp value=children let:children>
|
||||
<div class="thaw-checkbox__label">{children()}</div>
|
||||
</OptionComp>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue