Skip to content

Commit 81bd927

Browse files
committed
doc: 精简代码
1 parent cbd009e commit 81bd927

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/BootstrapBlazor.Server/Components/Samples/Scrolls.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<div class="scroll-demo border">
1212
<Scroll @ref="_scroll" Height="200px">
1313
<div class="m-1">@Localizer["ScrollNormalDescription"]</div>
14-
<div style="height: 100px; max-width: 200px; background-color: var(--bs-primary)"></div>
15-
<div style="height: 100px; max-width: 200px; background-color: var(--bs-secondary)"></div>
16-
<div style="height: 100px; max-width: 200px; background-color: var(--bs-warning)"></div>
17-
<div style="height: 100px; max-width: 200px; background-color: var(--bs-success)"></div>
18-
<div style="height: 100px; max-width: 200px; background-color: var(--bs-info)"></div>
14+
<div class="bg-primary" style="height: 100px;"></div>
15+
<div class="bg-secondary" style="height: 100px;"></div>
16+
<div class="bg-warning" style="height: 100px;"></div>
17+
<div class="bg-success" style="height: 100px;"></div>
18+
<div class="bg-info" style="height: 100px;"></div>
1919
<div class="m-1">@Localizer["ScrollNormalBottom"]</div>
2020
</Scroll>
2121
<Divider/>

src/BootstrapBlazor.Server/Components/Samples/Scrolls.razor.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@ private AttributeItem[] GetAttributes() =>
3434
}
3535
];
3636

37-
private Scroll? _scroll;
37+
[NotNull]
38+
private Scroll? _scroll = null;
3839

39-
private async Task ScrollToBottom()
40-
{
41-
if (_scroll != null)
42-
{
43-
await _scroll.ScrollToBottom();
44-
}
45-
46-
}
40+
private Task ScrollToBottom() => _scroll.ScrollToBottom();
4741
}

0 commit comments

Comments
 (0)