mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-12 11:55:24 +08:00
d16144ece0
* refactor: button * refactor: avatar * refactor: alert * fix: input group compact
41 lines
1017 B
C#
41 lines
1017 B
C#
using System.Collections.Generic;
|
|
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;
|
|
SetClassMap();
|
|
}
|
|
}
|
|
|
|
private readonly bool _isInDropdown = false;
|
|
|
|
private void SetClassMap()
|
|
{
|
|
string prefixName = "ant-btn-group";
|
|
ClassMapper.Clear().Add(prefixName)
|
|
.If("ant-dropdown-button", () => _isInDropdown)
|
|
.If($"{prefixName}-lg", () => this._size == "large")
|
|
.If($"{prefixName}-sm", () => this._size == "small");
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
base.OnInitialized();
|
|
SetClassMap();
|
|
}
|
|
}
|
|
}
|