千万别动原生wwwroot!
千万别动原生wwwroot!
千万别动原生wwwroot!
千万别卸Blazorise!
千万别卸Blazorise!
千万别卸Blazorise!
- 参照官网 新建Shared/MainLayout.razor
- 在Blazor项目根目录里新建文件App.razor内如如下
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
- 修改Index.razor
@page "/"
@using Handbook.Blazor.Shared
@layout MainLayout //添加这行
Hello World!