1.安装X.PagedList

GitHub 地址:https://github.com/dncuug/X.PagedList

.NET Core (.NET Standard 2.0)

  1. 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;

大概就这样啊。 嘿嘿

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐