@using Syncfusion.EJ2.Blazor.Navigations
<button class="e-btn" @onclick="@AddTab">Add Tab </button>
<EjsTab @ref="Tab">
<TabItems>
<TabItem Content="Twitter is an online social networking service">
<ChildContent>
<TabHeader Text="Twitter"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="@Content2">
<ChildContent>
<TabHeader Text="Facebook"></TabHeader>
</ChildContent>
</TabItem>
<TabItem Content="WhatsApp Messenger is a proprietary cross-platform">
<ChildContent>
<TabHeader Text="Whatsapp"></TabHeader>
</ChildContent>
</TabItem>
</TabItems>
</EjsTab>
@code {
private EjsTab Tab;
public List<TabItem> source;
public string Content2 { get; set; } = "Facebook is an online social networking service";
public void AddTab()
{
source = new List<TabItem>()
{
new TabItem() { Header = new TabHeader() { Text = "Sample 1" }, Content = "Sample Content" }
};
Tab.AddTab(source, 0); // To add tab item dynamically
}
} |