From 565c8958499b9cf4d3dfcbd0abfeed022cb22bbc Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Thu, 19 May 2022 08:12:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=8F=AA=E8=AF=BB=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=20ComponentType=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Utils/Utility.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/BootstrapBlazor/Utils/Utility.cs b/src/BootstrapBlazor/Utils/Utility.cs index 1bef8c38c..9682571db 100644 --- a/src/BootstrapBlazor/Utils/Utility.cs +++ b/src/BootstrapBlazor/Utils/Utility.cs @@ -265,10 +265,7 @@ public static class Utility var fieldType = item.PropertyType; var fieldName = item.GetFieldName(); var displayName = item.GetDisplayName() ?? GetDisplayName(model, fieldName); - var fieldValue = GenerateValue(model, fieldName); - var valueExpression = GenerateValueExpression(model, fieldName, fieldType); - var type = (Nullable.GetUnderlyingType(fieldType) ?? fieldType); if (type == typeof(bool) || fieldValue?.GetType() == typeof(bool)) { @@ -279,14 +276,22 @@ public static class Utility builder.AddAttribute(4, nameof(Switch.ShowLabelTooltip), item.ShowLabelTooltip); builder.CloseComponent(); } + else if (item.ComponentType == typeof(Textarea)) + { + builder.OpenComponent(0, typeof(Textarea)); + builder.AddAttribute(1, nameof(Textarea.DisplayText), displayName); + builder.AddAttribute(2, nameof(Textarea.Value), fieldValue); + builder.AddAttribute(3, nameof(Textarea.ShowLabelTooltip), item.ShowLabelTooltip); + builder.AddAttribute(4, "readonly", true); + builder.CloseComponent(); + } else { builder.OpenComponent(0, typeof(Display<>).MakeGenericType(fieldType)); builder.AddAttribute(1, nameof(Display.DisplayText), displayName); builder.AddAttribute(2, nameof(Display.Value), fieldValue); - builder.AddAttribute(3, nameof(Display.ValueExpression), valueExpression); - builder.AddAttribute(4, nameof(Display.LookUpServiceKey), item.LookUpServiceKey); - builder.AddAttribute(5, nameof(Display.ShowLabelTooltip), item.ShowLabelTooltip); + builder.AddAttribute(3, nameof(Display.LookUpServiceKey), item.LookUpServiceKey); + builder.AddAttribute(4, nameof(Display.ShowLabelTooltip), item.ShowLabelTooltip); builder.CloseComponent(); } } -- Gitee From 1d34e85ff7ebccaa632174da70cde97c210d71d7 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Thu, 19 May 2022 09:59:00 +0800 Subject: [PATCH 2/2] chore: bump version 6.6.8 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 083e70046..45c2abcc9 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 6.6.7 + 6.6.8 -- Gitee