-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: build error without full pages (#193)
* fix: build error without full pages * fix using
- Loading branch information
1 parent
808be9a
commit 6710442
Showing
13 changed files
with
98 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
#else | ||
global using AntDesign.Pro.Resources; | ||
#endif | ||
|
||
global using AntDesign; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using AntDesign.Extensions.Localization; | ||
Check warning on line 1 in src/AntDesign.Pro/Layouts/BasicLayout.razor.cs
|
||
using AntDesign.ProLayout; | ||
using Microsoft.AspNetCore.Components; | ||
using System.Globalization; | ||
using System.Net.Http.Json; | ||
|
||
namespace AntDesign.Pro.Template.Layouts | ||
{ | ||
public partial class BasicLayout : LayoutComponentBase, IDisposable | ||
{ | ||
private MenuDataItem[] _menuData; | ||
|
||
[Inject] private ReuseTabsService TabService { get; set; } | ||
//#if (full) | ||
|
||
[Inject] private HttpClient HttpClient { get; set; } | ||
|
||
[Inject] private ILocalizationService LocalizationService { get; set; } | ||
|
||
private EventHandler<CultureInfo> _localizationChanged; | ||
|
||
//#endif | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
#if IsNotFull | ||
_menuData = new[] { | ||
new MenuDataItem | ||
{ | ||
Path = "/", | ||
Name = "welcome", | ||
Key = "welcome", | ||
Icon = "smile", | ||
} | ||
}; | ||
#else | ||
_localizationChanged = (sender, args) => InvokeAsync(StateHasChanged); | ||
LocalizationService.LanguageChanged += _localizationChanged; | ||
_menuData = await HttpClient.GetFromJsonAsync<MenuDataItem[]>("data/menu.json"); | ||
#endif | ||
} | ||
|
||
void Reload() | ||
{ | ||
TabService.ReloadPage(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
#if IsNotFull | ||
|
||
#else | ||
LocalizationService.LanguageChanged -= _localizationChanged; | ||
#endif | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters