Skip to content

Commit fd58e4a

Browse files
committed
refactor: 重构代码
1 parent 97fc831 commit fd58e4a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/BootstrapBlazor/Components/Tab/Tab.razor.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,13 +594,6 @@ private void AddTabItem(string url)
594594
// TabItemOptionAttribute
595595
SetTabItemParameters(option.Text, option.Icon, option.Closable, true);
596596
}
597-
598-
else if (Layout != null)
599-
{
600-
// CascadeParameter Menus
601-
var menu = GetMenuItem(url);
602-
SetTabItemParameters(menu?.Text, menu?.Icon, true, true);
603-
}
604597
else if (Options.Valid())
605598
{
606599
// TabItemTextOptions
@@ -609,6 +602,11 @@ private void AddTabItem(string url)
609602
}
610603
else
611604
{
605+
var menu = GetMenuItem(url);
606+
if (menu != null)
607+
{
608+
SetTabItemParameters(menu.Text, menu.Icon, true, true);
609+
}
612610
parameters.Add(nameof(TabItem.Text), url.Split("/").FirstOrDefault());
613611
}
614612
parameters.Add(nameof(TabItem.Url), url);

0 commit comments

Comments
 (0)