fix(BasicTable): table表格宽度自适应,隐藏的列导致宽度增加 (#3388)

This commit is contained in:
TOUCHERS 2023-12-08 09:13:14 +08:00 committed by GitHub
parent 6b6b790f87
commit bca5154a9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -218,7 +218,9 @@ export function useTableScroll(
columns.forEach((item) => {
width += Number.parseFloat(item.width as string) || 0;
});
const unsetWidthColumns = columns.filter((item) => !Reflect.has(item, 'width'));
const unsetWidthColumns = columns.filter(
(item) => !Reflect.has(item, 'width') && item.ifShow !== false,
);
const len = unsetWidthColumns.length;
if (len !== 0) {