From 2faae1f48da64069fa858cc83a688a2a8b76c24b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 27 May 2025 14:40:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E7=B2=BE=E7=AE=80=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Input/BootstrapInputGroupLabel.razor | 36 ++++++------------- .../Input/BootstrapInputGroupLabel.razor.cs | 2 ++ 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor b/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor index 1904f073e6c..c616b00fcd9 100644 --- a/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor +++ b/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor @@ -1,29 +1,13 @@ @namespace BootstrapBlazor.Components @inherits DisplayBase -@if (IsInputGroupLabel) -{ -
- @if (ChildContent != null) - { - @ChildContent - } - else - { - @DisplayText - } -
-} -else -{ - -} + + @if (ChildContent != null) + { + @ChildContent + } + else + { + @DisplayText + } + diff --git a/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor.cs b/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor.cs index 8352b0e1ec4..8b1cdf0d3bf 100644 --- a/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor.cs +++ b/src/BootstrapBlazor/Components/Input/BootstrapInputGroupLabel.razor.cs @@ -23,6 +23,8 @@ public partial class BootstrapInputGroupLabel .AddClassFromAttributes(AdditionalAttributes) .Build(); + private string TagName => IsInputGroupLabel ? "div" : "label"; + /// /// 获得/设置 标签宽度 默认 null 未设置自动适应 /// From c8979e53db7ca6e8984c5ad0cbb0be5ec8a50e11 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Tue, 27 May 2025 14:40:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?style:=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Input/BootstrapInputGroup.razor.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss b/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss index 3af26a56b9f..77bf12cfa9b 100644 --- a/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss +++ b/src/BootstrapBlazor/Components/Input/BootstrapInputGroup.razor.scss @@ -1,4 +1,4 @@ -.input-group { +.input-group { > .datetime-picker, > .select, > .switch,