Skip to content

Commit

Permalink
fix(component:ant-table): fixed cash checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
huajian123 committed Jul 8, 2022
1 parent 9e17b6c commit bf8d323
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/app/shared/components/ant-table/ant-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export interface TableHeader {
tdClassList?: string[]; // 为td单元格指定类 (父组件中的类必须加上 /deep/ 前缀才能对子组件生效)
thClassList?: string[]; // 为th单元格指定类 (父组件中的类必须加上 /deep/ 前缀才能对子组件生效)
show?: boolean; // 是否显示列,false:不显示,其他:显示
tdClassFn?: (data:any,index:number) => string[];
thClassFn?: (data:any) => string[];
tdClassFn?: (data: any, index: number) => string[];
thClassFn?: (data: any) => string[];
}

export interface MyTableConfig {
Expand Down Expand Up @@ -219,9 +219,7 @@ export class AntTableComponent implements OnInit, OnChanges {
const index = this.checkedCashArrayFromComment.findIndex((cashItem) => {
return item.id === cashItem.id;
});
if (index !== -1) {
item['_checked'] = true;
}
item['_checked'] = index !== -1;
});
const allChecked = this._dataList.length > 0 && this._dataList.every((item) => {
return item['_checked'] === true;
Expand Down

0 comments on commit bf8d323

Please sign in to comment.