Skip to content

Commit 5263751

Browse files
committed
refactor: 增加多选参数支持
1 parent 8d746e9 commit 5263751

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ namespace BootstrapBlazor.Components;
99
/// </summary>
1010
public partial class SelectCity
1111
{
12+
/// <summary>
13+
/// 获得/设置 是否可多选 默认 false 单选
14+
/// </summary>
15+
[Parameter]
16+
public bool IsMultiple { get; set; }
17+
1218
private string? InputId => $"{Id}_input";
1319

1420
private string? ClassString => CssBuilder.Default("select bb-region")
@@ -32,6 +38,10 @@ private async Task OnClearValue()
3238

3339
private void OnSelectCity(string item)
3440
{
41+
if(IsMultiple)
42+
{
43+
44+
}
3545
if (!_values.Remove(item))
3646
{
3747
_values.Add(item);

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
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

5-
using Microsoft.AspNetCore.Components;
6-
75
namespace BootstrapBlazor.Components;
86

97
/// <summary>

0 commit comments

Comments
 (0)