Skip to content

Commit 5756553

Browse files
committed
refactor: 重构代码
1 parent 7bc48d2 commit 5756553

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/BootstrapBlazor/Extensions/ITableColumnExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public static void CopyValue(this ITableColumn dest, IEditorItem source)
5353
if (source.LookupService != null) dest.LookupService = source.LookupService;
5454
if (source.Readonly.HasValue) dest.Readonly = source.Readonly;
5555
if (source.Rows > 0) dest.Rows = source.Rows;
56+
if (source.Cols > 0) dest.Cols = source.Cols;
5657
if (source.SkipValidate) dest.SkipValidate = source.SkipValidate;
5758
if (!string.IsNullOrEmpty(source.Text)) dest.Text = source.Text;
5859
if (source.ValidateRules != null) dest.ValidateRules = source.ValidateRules;

src/BootstrapBlazor/Utils/Utility.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,12 @@ public static void CreateComponentByFieldType(this RenderTreeBuilder builder, Co
574574
return ret;
575575
}
576576

577-
private static List<SelectedItem> Clone(this IEnumerable<SelectedItem> source) => source.Select(d => new SelectedItem(d.Value, d.Text)
577+
private static List<SelectedItem> Clone(this IEnumerable<SelectedItem> source) => [.. source.Select(d => new SelectedItem(d.Value, d.Text)
578578
{
579579
Active = d.Active,
580580
IsDisabled = d.IsDisabled,
581581
GroupName = d.GroupName
582-
}).ToList();
582+
})];
583583

584584
private static object? GenerateValue(object model, string fieldName) => GetPropertyValue<object, object?>(model, fieldName);
585585

0 commit comments

Comments
 (0)