Blazor Simple Tutorial (2): Layout

foreword

Our current mainstream pages are all single-page layouts, that is, one page has a sidebar, a header, a lower sidebar, and a central theme.

insert image description here

BootstrapBlazor UI, Blazor Server mode configuration

layout

custom layout

Inject LayoutComponentBase

@inherits LayoutComponentBase
<h1>我是EmptyLayout布局</h1>

<main> @Body</main>

@code {

}

default layout

insert image description here

insert image description here
Default layout is set in App.razro

Layout settings by adding @layout in Razor Pages file

@layout EmptyLayout//point to the EmptyLayout layout

Guess you like

Origin blog.csdn.net/qq_44695769/article/details/132247114