版权声明:本文为Martin原创文章,未经Martin允许不得转载。 https://blog.csdn.net/qq_36279445/article/details/82814564
1.安装X.PagedList
GitHub 地址:https://github.com/dncuug/X.PagedList
.NET Core (.NET Standard 2.0)
- Install X.PagedList.Mvc.Core via NuGet - that will automatically install X.PagedList as well.
方法应该是:dotnet add package X.PagedList.Mvc.Core --version 7.5.0
安装完之后,在你项目中引用
using X.PagedList;
ok,按照 GitHub那个就OK了, 一个 to paged list()就差不多了
前台的 angular那边就往后传第几页就行了,pageIndex
<pagination [totalItems]="totalElments" (pageChanged)="pageChanged($event)"></pagination>
getAllGarbages(pageIndex: number) {
this.garbageServices.getAllGarbages(pageIndex).subscribe((result: any) => {
this.garbageList = result.garbageViewModels;
this.noRecord = result.totalElements === 0;
this.totalElments = result.totalElements;
大概就这样啊。 嘿嘿