fix(frontend): 修复百分比表格列宽与单元格居中
This commit is contained in:
@@ -31,6 +31,19 @@ test('百分比表格:没有列宽时平均分配', () => {
|
||||
)
|
||||
})
|
||||
|
||||
test('百分比表格:minWidth 作为比例权重并移除最小宽度约束', () => {
|
||||
const columns: TableColumnsType<Record<string, unknown>> = [
|
||||
{ title: 'A', dataIndex: 'a', minWidth: 100 },
|
||||
{ title: 'B', dataIndex: 'b', minWidth: 300 },
|
||||
]
|
||||
const result = normalizePercentColumns(columns)
|
||||
assert.deepEqual(
|
||||
result.map((column) => column.width),
|
||||
['25.0000%', '75.0000%'],
|
||||
)
|
||||
assert.ok(result.every((column) => !('minWidth' in column)))
|
||||
})
|
||||
|
||||
test('百分比表格:选择列预留 4%', () => {
|
||||
const columns: TableColumnsType<Record<string, unknown>> = [
|
||||
{ title: 'A', dataIndex: 'a', width: 100 },
|
||||
|
||||
Reference in New Issue
Block a user