mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-20 16:52:57 +00:00
Add SelectedIndex parameter to CodeTabs component
This commit is contained in:
parent
d1eb861fbc
commit
bc5c747f83
@ -1,5 +1,5 @@
|
||||
<MudTabs @bind-ActivePanelIndex="selectedIndex" PanelClass="code-block" MinimumTabWidth="30px" Class="mt-2">
|
||||
@foreach (var block in blocks)
|
||||
<MudTabs @bind-ActivePanelIndex="this.SelectedIndex" PanelClass="code-block" MinimumTabWidth="30px" Class="mt-2">
|
||||
@foreach (var block in this.blocks)
|
||||
{
|
||||
<MudTabPanel Text="@block.Title">
|
||||
@block.Fragment
|
||||
|
@ -7,8 +7,10 @@ public partial class CodeTabs : ComponentBase
|
||||
[Parameter]
|
||||
public RenderFragment? ChildContent { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int SelectedIndex { get; set; } = 0;
|
||||
|
||||
private readonly List<CodeTabItem> blocks = new();
|
||||
private int selectedIndex;
|
||||
|
||||
internal void RegisterBlock(string title, RenderFragment fragment)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user