0
点赞
收藏
分享

微信扫一扫

ABP vNext Blazor替换前端Layout

慎壹 2022-02-01 阅读 90
c#asp.net

千万别动原生wwwroot!

千万别动原生wwwroot!

千万别动原生wwwroot!

千万别卸Blazorise!

千万别卸Blazorise!

千万别卸Blazorise!

  1. 参照官网 新建Shared/MainLayout.razor
  2. 在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>
  1. 修改Index.razor
@page "/"
@using Handbook.Blazor.Shared
@layout MainLayout //添加这行
Hello World!
举报

相关推荐

0 条评论