From 818cf364a00703799e1889f2c3a679301ecbae73 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Thu, 8 Sep 2022 17:57:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20QueryAsync=20=E5=A2=9E=E5=8A=A0=20pageI?= =?UTF-8?q?ndex=20=E5=8F=82=E6=95=B0=20=E9=BB=98=E8=AE=A4=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Table/Table.razor.Edit.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs b/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs index b0a8dfa7c..ead6cad46 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.Edit.cs @@ -339,7 +339,7 @@ public partial class Table StateHasChanged(); } - private async Task QueryAsync(bool shouldRender) + private async Task QueryAsync(bool shouldRender, int? pageIndex = null) { if (ScrollMode == ScrollMode.Virtual && VirtualizeElement != null) { @@ -348,6 +348,10 @@ public partial class Table else { await InternalToggleLoading(true); + if(pageIndex.HasValue) + { + PageIndex = pageIndex.Value; + } await QueryData(); await InternalToggleLoading(false); } @@ -359,10 +363,10 @@ public partial class Table } /// - /// 查询按钮调用此方法 + /// 查询按钮调用此方法 参数 pageIndex 默认值 null 保持上次页码 第一页页码为 1 /// /// - public Task QueryAsync() => QueryAsync(true); + public Task QueryAsync(int? pageIndex = null) => QueryAsync(true, pageIndex); /// /// 显示/隐藏 Loading 遮罩 -- Gitee