Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 7cd78a2

Browse files
committed
add pagination of number
1 parent 9325aa6 commit 7cd78a2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/TDesign/Components/TPagination.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public class TPagination:BlazorComponentBase
5858
/// 设置分页页码条的显示数量。建议范围在 5-21 之间,默认是 7。
5959
/// </summary>
6060
[Parameter] public int PageNumber { get; set; } = 7;
61+
/// <summary>
62+
/// 设置是否显示页码条。
63+
/// </summary>
64+
[Parameter]public bool ShowPageNumber { get; set; }
6165
#endregion
6266

6367

@@ -137,12 +141,12 @@ void BuildPageNumbers(RenderTreeBuilder builder, int sequence)
137141
builder.CreateElement(sequence, "ul", content =>
138142
{
139143
var (start, end) = ComputePageNumber();
140-
for ( long i = start; i <=end; i++ )
144+
for ( long i = start+1; i <= end-1; i++ )
141145
{
142146
content.CreateElement((int)i, "li", i.ToString(), new { @class = "t-pagination__number" });
143147
}
144148

145-
}, new { @class = "t-pagination__pager" });
149+
}, new { @class = "t-pagination__pager" }, ShowPageNumber);
146150

147151

148152
/// <summary>

0 commit comments

Comments
 (0)