mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-06 05:59:45 +08:00
!773 feat(#I2A033): TabItem add new method
* feat: Add new method AddTab for Tab * feat: Add method for create new TabItem
This commit is contained in:
parent
842d74d06a
commit
1e32b7eda8
@ -257,6 +257,17 @@ namespace BootstrapBlazor.Components
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加 TabItem 方法
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
public void AddTab(Dictionary<string, object> parameters)
|
||||
{
|
||||
var item = TabItem.Create(parameters);
|
||||
_items.Add(item);
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除 TabItem 方法
|
||||
/// </summary>
|
||||
|
@ -8,6 +8,7 @@
|
||||
// **********************************
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BootstrapBlazor.Components
|
||||
{
|
||||
@ -67,5 +68,17 @@ namespace BootstrapBlazor.Components
|
||||
/// </summary>
|
||||
/// <param name="active"></param>
|
||||
public virtual void SetActive(bool active) => IsActive = active;
|
||||
|
||||
/// <summary>
|
||||
/// 通过指定参数集合获取 TabItem 实例
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
/// <returns></returns>
|
||||
public static TabItem Create(Dictionary<string, object> parameters)
|
||||
{
|
||||
var item = new TabItem();
|
||||
var _ = item.SetParametersAsync(ParameterView.FromDictionary(parameters));
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user