Skip to content

Commit 0db7fe8

Browse files
committed
refactor: 精简进度面板代码
1 parent 6fb15d0 commit 0db7fe8

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/BootstrapBlazor.Server/Components/Samples/Tutorials/Dashboard.razor

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,15 @@
130130
<Card IsShadow="true" HeaderText="分类进度">
131131
<BodyTemplate>
132132
<Scroll Height="320px" style="margin: -1rem; padding: 1rem;">
133-
<div>
134-
@{
135-
foreach (var item in Data.TestKKSGroupList)
136-
{
137-
<h4 class="small fw-bold">
138-
@item.KKS @item.NAM<span class="float-end">
139-
@(
140-
item.Percent
141-
)%
142-
</span>
143-
</h4>
144-
<BootstrapBlazor.Components.Progress Value="@item.Percent" IsAnimated="true" Color="@GetColor(item.Percent)" IsShowValue="true" Round="1"></BootstrapBlazor.Components.Progress>
145-
}
146-
}
147-
</div>
133+
@foreach (var item in Data.TestKKSGroupList)
134+
{
135+
<div class="progress-item">
136+
<div class="small fw-bold mb-2">
137+
@item.KKS @item.NAM<span class="float-end">@item.Percent%</span>
138+
</div>
139+
<BootstrapBlazor.Components.Progress Value="@item.Percent" IsAnimated="true" Color="@GetColor(item.Percent)" IsShowValue="true" Round="1"></BootstrapBlazor.Components.Progress>
140+
</div>
141+
}
148142
</Scroll>
149143
</BodyTemplate>
150144
</Card>

src/BootstrapBlazor.Server/Components/Samples/Tutorials/Dashboard.razor.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
.db-progress ::deep .progress {
2121
flex: 1;
2222
}
23+
24+
.progress-item:not(:last-child) {
25+
margin-block-end: 1rem;
26+
}

0 commit comments

Comments
 (0)