Skip to content

Commit 1da192b

Browse files
committed
refactor: Pageable 更改为 IsPagination
1 parent 91eebc2 commit 1da192b

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/BootstrapBlazor.Server/Components/Samples/ListViews.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<DemoBlock Title="@Localizer["PaginationTitle"]"
3636
Introduction="@Localizer["PaginationIntro"]"
3737
Name="Pagination">
38-
<ListView TItem="Product" Pageable="true" PageItems="4" OnQueryAsync="@OnQueryAsync" Height="620px">
38+
<ListView TItem="Product" IsPagination="true" PageItems="4" OnQueryAsync="@OnQueryAsync" Height="620px">
3939
<HeaderTemplate>
4040
<div>@Localizer["ProductListText"]</div>
4141
</HeaderTemplate>

src/BootstrapBlazor/Components/ListView/ListView.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@
5555
@EmptyText
5656
}
5757
</div>
58-
@if (FooterTemplate != null || Pageable)
58+
@if (FooterTemplate != null || IsPagination)
5959
{
6060
<div class="listview-footer">
6161
@if (FooterTemplate != null)
6262
{
6363
@FooterTemplate
6464
}
65-
else if (Pageable)
65+
else if (IsPagination)
6666
{
6767
<Pagination PageCount="@PageCount" PageIndex="@_pageIndex" OnPageLinkClick="@OnPageLinkClick"></Pagination>
6868
}

src/BootstrapBlazor/Components/ListView/ListView.razor.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ public partial class ListView<TItem> : BootstrapComponentBase
6666
/// 获得/设置 是否分页 默认为 false 不分页 设置 <see cref="FooterTemplate"/> 时分页功能自动被禁用
6767
/// </summary>
6868
[Parameter]
69-
public bool Pageable { get; set; }
69+
[Obsolete("已弃用,请使用 IsPagination 代替。Deprecated, use IsPagination instead")]
70+
[ExcludeFromCodeCoverage]
71+
public bool Pageable { get => IsPagination; set => IsPagination = value; }
72+
73+
/// <summary>
74+
/// 获得/设置 是否分页 默认为 false 不分页 设置 <see cref="FooterTemplate"/> 时分页功能自动被禁用
75+
/// </summary>
76+
[Parameter]
77+
public bool IsPagination { get; set; }
7078

7179
/// <summary>
7280
/// 获得/设置 分组 Lambda 表达式 默认 null
@@ -200,6 +208,7 @@ protected async Task QueryData()
200208
{
201209
queryData = await OnQueryAsync(new QueryPageOptions()
202210
{
211+
IsPage = IsPagination,
203212
PageIndex = _pageIndex,
204213
PageItems = PageItems,
205214
});

0 commit comments

Comments
 (0)