- 移动 App.razor, Routes.razor, _Imports.razor 到根目录
- 删除 Components 文件夹
- 修改 Routes.razor
<Project.AppCore.Layouts.AppRoot AppAssembly="typeof(App).Assembly"></Project.AppCore.Layouts.AppRoot>
<AntContainer/>
-
拷贝appsettings.json
-
修改 Program.cs
using Project.AppCore;
builder.Services.AddAntDesignUI();
builder.AddProject(setting =>
{
// ICustomSettingProvider的实现
setting.App.Name = "Demo";
setting.App.Id = "Test";
setting.App.Company = "Marvel";
setting.ConfigureSettingProviderType<CustomSetting>();
setting.AutoInjectConfig = filter =>
{
};
});
builder.AddDefaultLightOrm();
app.UseProject();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies([.. Config.Pages]);
- 修改 App.razor 添加样式和 js 引用
<link href="_content/AntDesign/css/ant-design-blazor.css" rel="stylesheet"/>
<script src="_content/AntDesign/js/ant-design-blazor.js"></script>
<link href="_content/Project.Web.Shared/css/app.css" rel="stylesheet"/>
<link href="_content/Project.Web.Shared/css/echarts.css" rel="stylesheet"/>
// 可选,配置重连样式
<Project.Web.Shared.Components.ReconnectorOutlet @rendermode="@InteractiveServer"></Project.Web.Shared.Components.ReconnectorOutlet>