diff --git a/src/components/pagination/nz-pagination.component.ts b/src/components/pagination/nz-pagination.component.ts index de75d2e030..e87fdebf85 100644 --- a/src/components/pagination/nz-pagination.component.ts +++ b/src/components/pagination/nz-pagination.component.ts @@ -194,6 +194,14 @@ export class NzPaginationComponent { this._jumpPage(this._current + Math.round(pageSize / 2)); } + /** page size changer select values */ + @Input() + set nzPageSizeSelectorValues(value: any) { + if (value) { + this._options = value; + } + } + @Input() get nzPageIndex(): number { diff --git a/src/components/table/nz-table.component.ts b/src/components/table/nz-table.component.ts index 919fccb5a6..75d76552a3 100644 --- a/src/components/table/nz-table.component.ts +++ b/src/components/table/nz-table.component.ts @@ -68,6 +68,7 @@ import { NzThDirective } from './nz-th.directive'; *ngIf="nzIsPagination&&data.length" class="ant-table-pagination" [nzShowSizeChanger]="nzShowSizeChanger" + [nzPageSizeSelectorValues]="nzPageSizeSelectorValues" [nzShowQuickJumper]="nzShowQuickJumper" [nzShowTotal]="nzShowTotal" [nzSize]="(nzSize=='middle'||nzSize=='small')?'small':''" @@ -112,6 +113,8 @@ export class NzTableComponent implements AfterViewInit, OnInit { @Input() nzShowFooter = false; @Input() nzShowTitle = false; @Input() nzIsPageIndexReset = true; + /** page size changer select values */ + @Input() nzPageSizeSelectorValues = [10, 20, 30, 40, 50]; @ContentChild('nzFixedHeader') fixedHeader: TemplateRef; @ContentChildren(NzThDirective, { descendants: true }) diff --git a/src/showcase/nz-demo-pagination/nz-demo-pagination.html b/src/showcase/nz-demo-pagination/nz-demo-pagination.html index 9ee6635d75..1d46958d5b 100644 --- a/src/showcase/nz-demo-pagination/nz-demo-pagination.html +++ b/src/showcase/nz-demo-pagination/nz-demo-pagination.html @@ -99,6 +99,12 @@

API attribute - + + nzPageSizeSelectorValues + 每页显示条目数下拉框值 + Array + [10, 20, 30, 40, 50] + nzShowQuickJumper 是否可以快速跳转至某页,当添加该属性时显示快速跳转 diff --git a/src/showcase/nz-demo-table/nz-demo-table.html b/src/showcase/nz-demo-table/nz-demo-table.html index 7e23f32a0a..9aaf193711 100644 --- a/src/showcase/nz-demo-table/nz-demo-table.html +++ b/src/showcase/nz-demo-table/nz-demo-table.html @@ -278,6 +278,12 @@

nz-table Boolean false + + nzPageSizeSelectorValues + pagination中每页显示条目数下拉框值 + Array + [10, 20, 30, 40, 50] + nzShowQuickJumper 是否显示pagination中快速跳转