如果我将 ngx-paginator 添加到 mat table,我将面临这个问题。请帮帮我。
<table mat-table [dataSource]="dataSource| paginate: {itemsPerPage: size, currentPage: p,
totalItems: EMP_DATA.length}" class="mat-elevation-z8" matSort>
.
.
<pagination-controls (pageChange)="p = $event;paginate(p)"
[responsive]="true"
></pagination-controls>
在 ts 文件中
size = 10;
pageIndex = 0;
p=1;
dataSource = new MatTableDataSource<EmpElement>(this.EMP_DATA);
paginate(event: any) {
this.pageIndex=event;
}