fix(common-table): 修复table组件无法切换页面

This commit is contained in:
禾几海
2021-03-11 20:22:23 +08:00
parent 288eb358a3
commit 02718d23db
2 changed files with 4 additions and 4 deletions

View File

@@ -12,7 +12,7 @@
<ng-template #table>
<ng-content></ng-content>
<nz-table (nzPageIndexChange)="getData()"
<nz-table (nzPageIndexChange)="getData($event)"
[(nzPageIndex)]="dataList.pageNum"
[nzData]="dataList.list"
[nzLoading]="loading"

View File

@@ -54,10 +54,10 @@ export class CommonTableComponent<T> implements OnInit, OnChanges {
this.getData();
}
getData = () => {
getData = (pageNumber?: number) => {
this.loading = true;
const pageValue = this.dataList.pageNum ? this.dataList.pageNum : 1;
const countValue = this.dataList.pageSize ? this.dataList.pageSize : 10
const pageValue = pageNumber ? pageNumber : 1;
const countValue = this.dataList.pageSize ? this.dataList.pageSize : 10;
this.request.queryParam.page = pageValue;
this.request.queryParam.count = countValue;