mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-03 12:37:40 +08:00
58c5f2b6cc
* tests: added * missed scenarios for Button and ButtonGroup
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class ButtonGroup : AntDomComponentBase
|
|
{
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
|
|
|
private string _size;
|
|
|
|
[Parameter]
|
|
public string Size
|
|
{
|
|
get => _size;
|
|
set
|
|
{
|
|
this._size = value;
|
|
}
|
|
}
|
|
|
|
private readonly bool _isInDropdown = false;
|
|
|
|
private void SetClassMap()
|
|
{
|
|
string prefixName = "ant-btn-group";
|
|
ClassMapper.Add(prefixName)
|
|
.If("ant-dropdown-button", () => _isInDropdown)
|
|
.If($"{prefixName}-lg", () => this._size == "large")
|
|
.If($"{prefixName}-sm", () => this._size == "small")
|
|
.If($"{prefixName}-rtl", () => RTL);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
base.OnInitialized();
|
|
SetClassMap();
|
|
}
|
|
}
|
|
}
|