Skip to content

Commit 83c8808

Browse files
committed
refactor: 更新私有属性为私有变量
1 parent c814a33 commit 83c8808

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ protected async Task QueryData(bool triggerByPagination = false)
484484
else
485485
{
486486
ResetSelectedRows(Items);
487-
RowsCache = null;
487+
_rowsCache = null;
488488
}
489489
return;
490490

@@ -513,7 +513,7 @@ async Task OnQuery(QueryPageOptions queryOption)
513513
}
514514

515515
// 更新数据后清除缓存防止新数据不显示
516-
RowsCache = null;
516+
_rowsCache = null;
517517
return;
518518

519519
void ProcessData()

src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ protected async Task<bool> SaveModelAsync(EditContext context, ItemChangedType c
648648
if (DynamicContext != null)
649649
{
650650
await DynamicContext.SetValue(context.Model);
651-
RowsCache = null;
651+
_rowsCache = null;
652652
valid = true;
653653
}
654654
else
@@ -1095,7 +1095,7 @@ private void ResetDynamicContext()
10951095

10961096
private void QueryDynamicItems(QueryPageOptions queryOption, IDynamicObjectContext? context)
10971097
{
1098-
RowsCache = null;
1098+
_rowsCache = null;
10991099
if (context != null)
11001100
{
11011101
var items = context.GetItems();

src/BootstrapBlazor/Components/Table/Table.razor.TreeNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected Func<Task> ToggleTreeRow(TItem item) => async () =>
106106
IsLoadChildren = false;
107107

108108
// 清除缓存
109-
RowsCache = null;
109+
_rowsCache = null;
110110

111111
// 更新 UI
112112
StateHasChanged();

src/BootstrapBlazor/Components/Table/Table.razor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ protected override void OnParametersSet()
935935
IsPagination = false;
936936
}
937937

938-
RowsCache = null;
938+
_rowsCache = null;
939939

940940
if (IsExcel)
941941
{
@@ -1274,7 +1274,7 @@ protected async Task LoopQueryAsync()
12741274
private IEnumerable<TItem> QueryItems { get; set; } = [];
12751275

12761276
[NotNull]
1277-
private List<TItem>? RowsCache { get; set; }
1277+
private List<TItem>? _rowsCache = null;
12781278

12791279
/// <summary>
12801280
/// 获得 当前表格所有 Rows 集合
@@ -1286,8 +1286,8 @@ public List<TItem> Rows
12861286
// https://gitee.com/LongbowEnterprise/BootstrapBlazor/issues/I5JG5D
12871287
// 如果 QueryItems 无默认值
12881288
// 页面 OnInitializedAsync 二刷再 OnAfterRender 过程中导致 QueryItems 变量为空 ToList 报错
1289-
RowsCache ??= IsTree ? TreeRows.GetAllItems() : [.. (Items ?? QueryItems)];
1290-
return RowsCache;
1289+
_rowsCache ??= IsTree ? TreeRows.GetAllItems() : [.. (Items ?? QueryItems)];
1290+
return _rowsCache;
12911291
}
12921292
}
12931293

0 commit comments

Comments
 (0)