diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnResizing.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnResizing.razor index 53486308361..99c8e04ec33 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnResizing.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnResizing.razor @@ -44,9 +44,10 @@ -

@((MarkupString)Localizer["AllowResizingDesc"].Value)

+
@((MarkupString)Localizer["AllowResizingDesc"].Value)
diff --git a/src/BootstrapBlazor.Server/Locales/zh.json b/src/BootstrapBlazor.Server/Locales/zh.json index 7efebfc9250..576d9a740ce 100644 --- a/src/BootstrapBlazor.Server/Locales/zh.json +++ b/src/BootstrapBlazor.Server/Locales/zh.json @@ -4822,7 +4822,7 @@ "WidthP3": "通过设置按钮 IsShow 参数来控制是否显示按钮", "AllowResizingTitle": "允许列调整", "AllowResizingIntro": "通过指定 AllowResizing 设置表格列允许调整宽度", - "AllowResizingDesc": "注意:Table 父容器有有效宽度值时 Table 才会出现滚动条", + "AllowResizingDesc": "注意:Table 父容器有有效宽度值时 Table 才会出现滚动条,可通过设置 ClientTableName 参数开启本地化存储列宽功能,即通过拖拽后列宽下次打开时会保持", "WidthButtonText1": "明细", "WidthButtonText2": "编辑", "WidthButtonText3": "权限", diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 6878443d52e..afc237d8f3a 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 8.0.3-beta02 + 8.0.3-beta03 diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 49abdff5767..6d1040061ee 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -579,7 +579,7 @@ public void ExpandDetailRow(TItem item) /// 获得/设置 表格名称 默认 null 用于列宽持久化功能 /// [Parameter] - public string? TableName { get; set; } + public string? ClientTableName { get; set; } [CascadingParameter] [NotNull] @@ -836,14 +836,14 @@ protected override async Task OnAfterRenderAsync(bool firstRender) ? $"width: {_localStorageTableWidth.Value}px;" : null; - private string? GetTableName(bool hasHeader) => hasHeader ? TableName : null; + private string? GetTableName(bool hasHeader) => hasHeader ? ClientTableName : null; private async Task> ReloadColumnWidth() { IEnumerable? ret = null; - if (!string.IsNullOrEmpty(TableName) && AllowResizing) + if (!string.IsNullOrEmpty(ClientTableName) && AllowResizing) { - var jsonData = await InvokeAsync("reloadColumnWidth", Id, TableName); + var jsonData = await InvokeAsync("reloadColumnWidth", Id, ClientTableName); if (!string.IsNullOrEmpty(jsonData)) { try diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index f8de4374adb..b89443932cb 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -579,10 +579,11 @@ export function sort(id) { export function load(id, method) { const table = Data.get(id) - const loader = table.el.querySelector('.table-loader') + const loader = [...table.el.children].find(el => el.classList.contains('table-loader')); if (method === 'show') { loader.classList.add('show') - } else { + } + else { loader.classList.remove('show') } }