Skip to content

Commit 0de82a5

Browse files
committed
添加treeview手动清空缓存方法,因为如果组件一直存在,而items不断增删更新的话,缓存不会释放
1 parent 84764e3 commit 0de82a5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ protected override void OnInitialized()
303303
ToolbarEditLabelText ??= Localizer[nameof(ToolbarEditLabelText)];
304304
}
305305

306+
/// <summary>
307+
/// Clear the cache of the tree node state.
308+
/// </summary>
309+
public void ClearCache()
310+
{
311+
_treeNodeStateCache?.Reset();
312+
}
313+
306314
/// <summary>
307315
/// <inheritdoc/>
308316
/// </summary>

0 commit comments

Comments
 (0)