Skip to content

Commit afabc3c

Browse files
committed
refactor: 增加持久化逻辑
1 parent 2fb6189 commit afabc3c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6-
using System.Text.Json;
7-
86
namespace BootstrapBlazor.Components;
97

108
public partial class Table<TItem>
@@ -157,9 +155,9 @@ private async Task OnToggleColumnVisible(string columnName, bool visible)
157155
{
158156
_resetColumns = true;
159157
}
160-
if(ClientTableName != null && ShowColumnList)
158+
if (ClientTableName != null && ShowColumnList)
161159
{
162-
await JSRuntime.InvokeVoidAsync("localStorage.setItem", "bb-table-column-visiable-"+ClientTableName, JsonSerializer.Serialize(_visibleColumns) ?? "");
160+
await InvokeVoidAsync("saveColumnList", ClientTableName, _visibleColumns);
163161
}
164162
if (OnColumnVisibleChanged != null)
165163
{

0 commit comments

Comments
 (0)