Skip to content

Commit f4bae15

Browse files
committed
refactor: 增加 IsReset 支持
1 parent 4971fbf commit f4bae15

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BootstrapBlazor/Components/TreeView/TreeView.razor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ protected override void OnParametersSet()
345345
SearchIcon ??= IconTheme.GetIconByKey(ComponentIcons.TreeViewSearchIcon);
346346
ClearSearchIcon ??= IconTheme.GetIconByKey(ComponentIcons.TreeViewResetSearchIcon);
347347
LoadingIcon ??= IconTheme.GetIconByKey(ComponentIcons.TreeViewLoadingIcon);
348+
349+
if (IsReset)
350+
{
351+
_rows = null;
352+
}
348353
}
349354

350355
/// <summary>
@@ -353,7 +358,6 @@ protected override void OnParametersSet()
353358
/// <returns></returns>
354359
protected override async Task OnParametersSetAsync()
355360
{
356-
_rows = null;
357361
Items ??= [];
358362
if (Items.Count > 0)
359363
{

0 commit comments

Comments
 (0)