File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed
example/AntDesign.ProLayout.Wasm/Shared Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 4141<SettingDrawer />
4242
4343@inject HttpClient HttpClient
44+ @inject IconService iconService ;
45+
4446@code
4547{
4648 private MenuDataItem [] MenuData { get ; set ; } = {};
5254 {
5355 await base .OnInitializedAsync ();
5456 var data = await HttpClient .GetFromJsonAsync <List <MenuDataItem >>(" data/menu.json" );
57+ data [0 ].IconFont = " icon-tuichu" ;
5558 data .Insert (0 , new MenuDataItem
5659 {
5760 TitleTemplate = @< span >< Icon Type = " user" >< / Icon > Custom Menu < / span > ,
6366 {
6467 openKeys = [];
6568 }
69+
70+ protected override async Task OnAfterRenderAsync (bool firstRender )
71+ {
72+ if (firstRender )
73+ {
74+ await iconService .CreateFromIconfontCN (" //at.alicdn.com/t/font_8d5l8fzk5b87iudi.js" );
75+ }
76+ }
6677}
Original file line number Diff line number Diff line change 5151 <Exec WorkingDirectory =" $(SolutionDir)" Command =" npm install" />
5252 <Exec WorkingDirectory =" $(SolutionDir)" Command =" npm run gulp:layout" />
5353 </Target >
54-
54+
5555 <ItemGroup >
5656 <Content Update =" **\*.razor" >
5757 <Pack >false</Pack >
Original file line number Diff line number Diff line change 2323 return @< span >
2424 @if (! string .IsNullOrEmpty (menuItem .Icon ))
2525 {
26- < Icon Type = " @menuItem.Icon" Theme = " outline" / >
26+ < Icon IconFont = " @menuItem.IconFont " Type = " @menuItem.Icon" Theme = " outline" / >
2727 }
2828 < span > @menuItem .Name < / span >
2929 < / span >
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ public class MenuDataItem
1010 public bool HideChildrenInMenu { get ; set ; }
1111 public bool HideInMenu { get ; set ; }
1212 public string Icon { get ; set ; }
13+ public string IconFont { get ; set ; }
1314 public string Locale { get ; set ; }
1415 public virtual string Name { get ; set ; }
1516 public string Key { get ; set ; }
You can’t perform that action at this time.
0 commit comments