fix: table column should support blank column occupancy (#4350)

* fix: table column

* fix: table column
This commit is contained in:
Katherine 2024-05-14 20:59:54 +08:00 committed by GitHub
parent 21ab4c5d45
commit c293929daa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -157,16 +157,17 @@ const useTableColumns = (props: { showDel?: boolean; isSubTable?: boolean }) =>
if (!exists) { if (!exists) {
return columns; return columns;
} }
const res = [...columns]; const res = [
if (designable) { ...columns,
res.push({ {
title: render(), title: render(),
dataIndex: 'TABLE_COLUMN_INITIALIZER', dataIndex: 'TABLE_COLUMN_INITIALIZER',
key: 'TABLE_COLUMN_INITIALIZER', key: 'TABLE_COLUMN_INITIALIZER',
render: () => <div style={{ minWidth: 180 }} />, render: designable ? () => <div style={{ minWidth: 180 }} /> : null,
fixed: 'right', fixed: designable ? 'right' : 'none',
}); },
} ];
if (props.showDel) { if (props.showDel) {
res.push({ res.push({
title: '', title: '',