Skip to content

Commit 8d5d690

Browse files
authored
doc(Router): compatible with NET10 (#7054)
1 parent d443952 commit 8d5d690

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed
Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,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>
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+
}

0 commit comments

Comments
 (0)