Skip to content

Commit f23d8b4

Browse files
authored
chore(Route): update NotFound parameter (#7106)
* refactor: 精简 Route 页面 * chore: 更新编码
1 parent 1512b3d commit f23d8b4

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<IsWebProject>true</IsWebProject>
Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
1-
@if (IsNet10OrGreater)
2-
{
3-
<Router AppAssembly="@typeof(Program).Assembly" NotFoundPage="typeof(Pages.NotFound)">
4-
<Found Context="routeData">
5-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
6-
<FocusOnNavigate RouteData="routeData" Selector="h3" />
7-
</Found>
8-
</Router>
9-
}
10-
else
11-
{
12-
<Router AppAssembly="@typeof(Program).Assembly">
13-
<Found Context="routeData">
14-
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
15-
<FocusOnNavigate RouteData="routeData" Selector="h3" />
16-
</Found>
17-
</Router>
18-
}
19-
20-
@code {
21-
#if NET10_0_OR_GREATER
22-
private bool IsNet10OrGreater => true;
23-
#else
24-
private bool IsNet10OrGreater => false;
25-
#endif
26-
}
1+
<Router AppAssembly="@typeof(Program).Assembly" NotFoundPage="typeof(Pages.NotFound)">
2+
<Found Context="routeData">
3+
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="routeData" Selector="h3" />
5+
</Found>
6+
</Router>

0 commit comments

Comments
 (0)