Skip to content

Commit

Permalink
fix: proTable 支持 hideInTable 列,目前计算 tableWidth 没有剔除 hideInTable 列
Browse files Browse the repository at this point in the history
  • Loading branch information
zhb127 committed May 13, 2022
1 parent 18c5950 commit a13f1bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/useAntdResizableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type ColumnOriginType<T> = {
children?: T[];
resizable?: boolean;
ellipsis?: any;
hideInTable?: boolean;
};

type CacheType = { width?: Width; index: number };
Expand Down Expand Up @@ -171,7 +172,9 @@ function useAntdResizableHeader<ColumnType extends ColumnOriginType<ColumnType>
if (cls[i].children) {
loop(cls[i].children as ColumnType[]);
} else {
width += Number(cls[i].width) || Number(columns?.[columns.length - 1].width) || defaultWidth;
if (cls[i].hideInTable === false) {
width += Number(cls[i].width) || Number(columns?.[columns.length - 1].width) || defaultWidth;
}
}
}
})(resizableColumns);
Expand Down

0 comments on commit a13f1bb

Please sign in to comment.