Skip to content

Commit c19e09d

Browse files
committed
refactor: 移动 InputId 到基类
1 parent 77ee4dd commit c19e09d

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/components/BootstrapBlazor.Region/Components/SelectCity.razor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ public partial class SelectCity
1515
[Parameter]
1616
public bool IsMultiple { get; set; }
1717

18-
private string InputId => $"{Id}_input";
19-
2018
private string? ClassString => CssBuilder.Default("select bb-city")
2119
.AddClass("disabled", IsDisabled)
2220
.AddClassFromAttributes(AdditionalAttributes)

src/components/BootstrapBlazor.Region/Components/SelectProvince.razor.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

@@ -15,8 +15,6 @@ public partial class SelectProvince
1515
[Parameter]
1616
public bool IsMultiple { get; set; }
1717

18-
private string InputId => $"{Id}_input";
19-
2018
private string? ClassString => CssBuilder.Default("select bb-province")
2119
.AddClass("disabled", IsDisabled)
2220
.AddClassFromAttributes(AdditionalAttributes)

src/components/BootstrapBlazor.Region/Components/SelectRegion.razor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ namespace BootstrapBlazor.Components;
99
/// </summary>
1010
public partial class SelectRegion
1111
{
12-
private string InputId => $"{Id}_input";
13-
1412
private string? ClassString => CssBuilder.Default("select bb-region")
1513
.AddClass("disabled", IsDisabled)
1614
.AddClassFromAttributes(AdditionalAttributes)

src/components/BootstrapBlazor.Region/Components/SelectRegionBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ public abstract class SelectRegionBase : PopoverSelectBase<string>
8383
.AddClass($"text-danger", IsValid.HasValue && !IsValid.Value)
8484
.Build();
8585

86+
/// <summary>
87+
/// 获得 选择框组件 Id
88+
/// </summary>
89+
protected string InputId => $"{Id}_input";
90+
8691
/// <summary>
8792
/// <inheritdoc/>
8893
/// </summary>

0 commit comments

Comments
 (0)