Skip to content

Commit

Permalink
🆕 feat: Change rendermode from Server to Auto (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Mar 29, 2024
1 parent bf522b8 commit 73fb9a6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
5 changes: 2 additions & 3 deletions Masa.Blazor.Pro.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

var builder = WebAssemblyHostBuilder.CreateDefault(args);

builder.Services.AddMasaBlazor(options =>
await builder.Services.AddMasaBlazor(options =>
{
options.ConfigureTheme(theme =>
{
theme.Themes.Light.Primary = "#4318FF";
theme.Themes.Light.Accent = "#4318FF";
});
});
// .AddI18nForWasmAsync($"{builder.HostEnvironment.BaseAddress}/i18n");
}).AddI18nForWasmAsync($"{builder.HostEnvironment.BaseAddress}/i18n");

await builder.Services.AddGlobalForWasmAsync(builder.HostEnvironment.BaseAddress);

Expand Down
4 changes: 2 additions & 2 deletions Masa.Blazor.Pro/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<link href="css/masa-blazor-pro.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="Masa.Blazor.Pro.styles.css" rel="stylesheet" />
<HeadOutlet @rendermode="@InteractiveServer" />
<HeadOutlet @rendermode="@InteractiveAuto" />
</head>

<body>
<Routes @rendermode="@InteractiveServer" />
<Routes @rendermode="@InteractiveAuto" />
<script src="_framework/blazor.web.js"></script>
<script src="_content/BlazorComponent/js/blazor-component.js"></script>
<script src="https://cdn.masastack.com/npm/echarts/5.1.1/echarts.min.js"></script>
Expand Down
9 changes: 0 additions & 9 deletions Masa.Blazor.Pro/Masa.Blazor.Pro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@
<Content Update="wwwroot\nav\nav.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\i18n\en-US.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\i18n\supportedCultures.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\i18n\zh-CN.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions Masa.Blazor.Pro/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// Add services to the container.
builder.Services.AddRazorComponents()
// .AddInteractiveWebAssemblyComponents()
.AddInteractiveWebAssemblyComponents()
.AddInteractiveServerComponents();

builder.Services.AddMasaBlazor(options =>
Expand Down Expand Up @@ -36,7 +36,7 @@

app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
// .AddInteractiveWebAssemblyRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof(Routes).Assembly);

app.Run();

0 comments on commit 73fb9a6

Please sign in to comment.