feat: clear code

This commit is contained in:
luoxiao 2024-05-16 16:18:36 +08:00
parent 7231e0cac1
commit f178d7c9ca
3 changed files with 5 additions and 24 deletions

View file

@ -83,9 +83,9 @@ impl IntoView for MenuGroupOption {
let Self { label, children } = self; let Self { label, children } = self;
let children_len = children.len(); let children_len = children.len();
view! { view! {
<Text> <Caption1Strong>
{format!("{label} ({children_len})")} {format!("{label} ({children_len})")}
</Text> </Caption1Strong>
{children.into_iter().map(|v| v.into_view()).collect_view()} {children.into_iter().map(|v| v.into_view()).collect_view()}
}.into_view() }.into_view()
} }
@ -99,7 +99,6 @@ pub(crate) struct MenuItemOption {
impl IntoView for MenuItemOption { impl IntoView for MenuItemOption {
fn into_view(self) -> View { fn into_view(self) -> View {
let Self { label, value } = self; let Self { label, value } = self;
// key=value label
view! { <NavItem value>{label}</NavItem> } view! { <NavItem value>{label}</NavItem> }
} }
} }

View file

@ -4,7 +4,9 @@
view! { view! {
<Card> <Card>
<CardHeader> <CardHeader>
<Body1>"Header"</Body1> <Body1>
<b>"Header"</b>"2022-02-22"
</Body1>
<CardHeaderDescription slot> <CardHeaderDescription slot>
<Caption1>"Description"</Caption1> <Caption1>"Description"</Caption1>
</CardHeaderDescription> </CardHeaderDescription>

View file

@ -22,23 +22,3 @@
.thaw-card > .thaw-card-preview { .thaw-card > .thaw-card-preview {
margin: 0 calc(var(--thaw-card--size)* -1); margin: 0 calc(var(--thaw-card--size)* -1);
} }
.thaw-card__header-extra {
display: flex;
align-items: center;
}
.thaw-card__header-content {
flex: 1;
}
.thaw-card__header,
.thaw-card__content,
.thaw-card__footer {
padding: 12px 28px;
}
.thaw-card__header {
padding: 20px 28px;
}
.thaw-card__header + .thaw-card__content,
.thaw-card__footer {
padding: 0 28px 20px;
}