mirror of
https://github.com/adoyle0/thaw.git
synced 2025-03-11 21:32:54 -04: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! {
|
view! {
|
||||||
<Checkbox value>"Click"</Checkbox>
|
<Checkbox value>"Click"</Checkbox>
|
||||||
|
<Checkbox />
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ use leptos::*;
|
||||||
pub fn Checkbox(
|
pub fn Checkbox(
|
||||||
#[prop(optional, into)] value: Model<bool>,
|
#[prop(optional, into)] value: Model<bool>,
|
||||||
#[prop(optional, into)] class: MaybeSignal<String>,
|
#[prop(optional, into)] class: MaybeSignal<String>,
|
||||||
children: Children,
|
#[prop(optional)] children: Option<Children>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
let theme = use_theme(Theme::light);
|
let theme = use_theme(Theme::light);
|
||||||
mount_style("checkbox", include_str!("./checkbox.css"));
|
mount_style("checkbox", include_str!("./checkbox.css"));
|
||||||
|
@ -50,7 +50,9 @@ pub fn Checkbox(
|
||||||
</Then>
|
</Then>
|
||||||
</If>
|
</If>
|
||||||
</div>
|
</div>
|
||||||
<div class="thaw-checkbox__label">{children()}</div>
|
<OptionComp value=children let:children>
|
||||||
|
<div class="thaw-checkbox__label">{children()}</div>
|
||||||
|
</OptionComp>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue