36 lines
1.9 KiB
Plaintext
36 lines
1.9 KiB
Plaintext
<!--
|
|
Router: Blazor의 라우팅 기능을 제공하는 컴포넌트
|
|
AppAssembly: 현재 애플리케이션의 어셈블리를 지정
|
|
Blazor는 @page가 붙은 .razor 파일을 찾아서 App 어셈블리 안에서 자동으로 라우팅을 찾아 설정
|
|
-->
|
|
<Router AppAssembly="@typeof(App).Assembly">
|
|
|
|
@* <!-- *@
|
|
@* Found: URL에 해당하는 페이지가 존재해 라우팅이 성공적으로 이루어졌을 때 실행 *@
|
|
@* Context="routeData": Found 컴포넌트에 전달된 해당하는 URL 페이지의 라우팅 정보를 routeData 라는 이름으로 사용 *@
|
|
@* RouteView: 실제로 해당 URL 에 해당하는 .razor 페이지를 렌더링 *@
|
|
@* RouteData="@routeData": Found 에서 전달된 라우팅 결과 *@
|
|
@* DefaultLayout="@typeof(MainLayout)": 해당 페이지에 @layout 이 없다면 사용 할 기본 레이아웃을 지정 *@
|
|
@* FocusOnNavigate: URL이 변경되었을 때 페이지의 특정 요소에 포커스를 맞추는 컴포넌트 - 접근성이나 키보드 탐색을 위한 UX 개선 요소 *@
|
|
@* RouteData="@routeData": Found 에서 전달된 라우팅 결과 *@
|
|
@* Selector="h1": 포커스를 맞출 요소를 지정 *@
|
|
@* --> *@
|
|
<Found Context="routeData">
|
|
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
|
|
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
|
|
</Found>
|
|
|
|
<!--
|
|
NotFound: URL에 해당하는 페이지가 존재하지 않을 때 실행
|
|
LayoutView: 레이아웃을 지정하는 컴포넌트
|
|
Layout="@typeof(MainLayout)": 레이아웃을 지정
|
|
role="alert": 스크린 리더와 같은 보조 기술에 의해 읽히는 경고 메시지
|
|
-->
|
|
<NotFound>
|
|
<PageTitle>Not found</PageTitle>
|
|
<LayoutView Layout="@typeof(MainLayout)">
|
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
|
</LayoutView>
|
|
</NotFound>
|
|
</Router>
|