Skip to content

Commit 0eaa75e

Browse files
committed
refactor: 快速上手增加组件总数信息
1 parent eb856f0 commit 0eaa75e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/BootstrapBlazor.Server/Extensions/MenusLocalizerExtensions.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@ public static List<MenuItem> GenerateMenus(this IStringLocalizer<NavMenu> Locali
1313
{
1414
var menus = new List<MenuItem>();
1515

16-
// 快速入门
1716
var item = new DemoMenuItem()
18-
{
19-
Text = Localizer["GetStarted"],
20-
Icon = "fa-solid fa-fw fa-font-awesome"
21-
};
22-
AddQuickStar(item);
23-
24-
item = new DemoMenuItem()
2517
{
2618
Text = Localizer["LayoutComponents"],
2719
Icon = "fa-fw fa-solid fa-desktop"
@@ -126,6 +118,14 @@ public static List<MenuItem> GenerateMenus(this IStringLocalizer<NavMenu> Locali
126118
};
127119
AddBootstrapBlazorUtility(item);
128120

121+
// 快速入门
122+
item = new DemoMenuItem()
123+
{
124+
Text = Localizer["GetStarted"],
125+
Icon = "fa-solid fa-fw fa-font-awesome"
126+
};
127+
AddQuickStar(item);
128+
129129
return menus;
130130

131131
void AddBootstrapBlazorUtility(DemoMenuItem item)
@@ -310,7 +310,7 @@ void AddQuickStar(DemoMenuItem item)
310310
Url = "layout-page"
311311
}
312312
};
313-
AddBadge(item, count: 0);
313+
AddSummary(item);
314314
}
315315

316316
void AddForm(DemoMenuItem item)
@@ -1689,7 +1689,7 @@ void AddSummary(DemoMenuItem item)
16891689
var count = 0;
16901690
count = menus.OfType<DemoMenuItem>().Sum(i => i.Count);
16911691
AddBadge(item, false, count);
1692-
menus.Insert(1, item);
1692+
menus.Insert(0, item);
16931693
}
16941694

16951695
void AddBadge(DemoMenuItem item, bool append = true, int? count = null)

0 commit comments

Comments
 (0)