Skip to content

Commit

Permalink
refactor(Table): use ScrollWidth variable replace const 6px (#2969)
Browse files Browse the repository at this point in the history
* refactor: 精简代码

* refactor: 参数变量化
  • Loading branch information
ArgoZhang authored Feb 20, 2024
1 parent 65255a9 commit 8e32e16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/BootstrapBlazor/Components/Table/Table.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const setResizeListener = table => {
const tableEl = curCol.closest('table')
let width = tableWidth + marginX
if (t.closest('.table-fixed-body')) {
width = width - 6
width = width - table.scrollWidth;
}
tableEl.setAttribute('style', `width: ${width}px;`)
}
Expand Down
5 changes: 1 addition & 4 deletions src/BootstrapBlazor/Utils/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,7 @@ public static void CreateComponentByFieldType(this RenderTreeBuilder builder, Co

builder.AddMultipleAttributes(17, CreateMultipleAttributes(fieldType, model, fieldName, item));

if (item.ComponentParameters != null)
{
builder.AddMultipleAttributes(18, item.ComponentParameters);
}
builder.AddMultipleAttributes(18, item.ComponentParameters);

// 设置 IsPopover
if (componentType.GetPropertyByName(nameof(Select<string>.IsPopover)) != null)
Expand Down

0 comments on commit 8e32e16

Please sign in to comment.