Skip to content

Commit a093b45

Browse files
committed
refactor: 增加逻辑
1 parent 5235a43 commit a093b45

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ const autoFitColumnWidth = async (table, col) => {
742742
maxWidth = Math.max(maxWidth, calcCellWidth(cell));
743743
});
744744

745+
if (table.options.fitColumnWidthIncludeHeader) {
746+
const th = col.closest('th');
747+
const span = th.querySelector('.table-cell');
748+
maxWidth = Math.max(maxWidth, calcCellWidth(span));
749+
}
750+
745751
if (table.options.autoFitColumnWidthCallback !== null) {
746752
const widthValue = await table.invoke.invokeMethodAsync(table.options.autoFitColumnWidthCallback, field, maxWidth);
747753
if (widthValue > 0) {

0 commit comments

Comments
 (0)