1.安装X.PagedList
GitHub 地址:https://github.com/dncuug/X.PagedList
方法应该是: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;
大概就这样啊。 嘿嘿