mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12:56 +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">
|
<MudTabs @bind-ActivePanelIndex="this.SelectedIndex" PanelClass="code-block" MinimumTabWidth="30px" Class="mt-2">
|
||||||
@foreach (var block in blocks)
|
@foreach (var block in this.blocks)
|
||||||
{
|
{
|
||||||
<MudTabPanel Text="@block.Title">
|
<MudTabPanel Text="@block.Title">
|
||||||
@block.Fragment
|
@block.Fragment
|
||||||
|
@ -7,8 +7,10 @@ public partial class CodeTabs : ComponentBase
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public RenderFragment? ChildContent { get; set; }
|
public RenderFragment? ChildContent { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public int SelectedIndex { get; set; } = 0;
|
||||||
|
|
||||||
private readonly List<CodeTabItem> blocks = new();
|
private readonly List<CodeTabItem> blocks = new();
|
||||||
private int selectedIndex;
|
|
||||||
|
|
||||||
internal void RegisterBlock(string title, RenderFragment fragment)
|
internal void RegisterBlock(string title, RenderFragment fragment)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user