mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-14 17:01:18 +08:00
6a52961487
* fix: other values may exist in FileAttributes * feat: add javascript interop for select component * feat: init select component * docs: add menu item to select docs * feat: implement dropdownRender for select component * docs: init select docs * fix: remove 3.0 iframe Co-authored-by: ElderJames <shunjiey@hotmail.com>
70 lines
1.5 KiB
C#
70 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
#pragma warning disable 1591
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class SelectOptGroup : AntDomComponentBase
|
|
{
|
|
#region Private
|
|
private const string ClassNamePrefix = "ant-select-item-group";
|
|
#endregion
|
|
|
|
#region Protected
|
|
#region Properties
|
|
|
|
protected IList<SelectOption> SelectOptions { get; set; } = new List<SelectOption>();
|
|
|
|
#endregion Properties
|
|
|
|
#region Methods
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
SetClassMap();
|
|
base.OnInitialized();
|
|
}
|
|
|
|
protected void SetClassMap()
|
|
{
|
|
ClassMapper.Clear()
|
|
.Add("ant-select-item")
|
|
.Add(ClassNamePrefix);
|
|
}
|
|
|
|
#endregion Methods
|
|
|
|
#endregion Protected
|
|
|
|
#region Public
|
|
|
|
#region Properties
|
|
|
|
#region Parameters
|
|
[Parameter] public string Key { get; set; }
|
|
|
|
[Parameter] public string Label { get; set; }
|
|
|
|
[CascadingParameter] public Select Parent { get; set; }
|
|
|
|
[Parameter] public RenderFragment ChildContent { get; set; }
|
|
|
|
#endregion Parameters
|
|
|
|
#endregion Properties
|
|
|
|
#region Methods
|
|
|
|
public void AddOption(SelectOption option)
|
|
{
|
|
SelectOptions.Add(option);
|
|
Parent.AddOption(option);
|
|
}
|
|
|
|
#endregion Methods
|
|
|
|
#endregion Public
|
|
}
|
|
}
|