代码拉取完成,页面将自动刷新
A reuse tabs demo for Ant Design Blazor.
https://antblazor.com/demo-reuse-tabs/
Follow the installation steps of AntDesign and install the AntDeisgn dependencies.
First of all, create a blazor project using dotnet new
command.
Modify the App.razor
file, replace the RouteView
with ReuseTabsRouteView
.
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
- <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" / >
+ <ReuseTabsRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
...
</Router>
Then modify the MainLayout.razor
file, add the ReuseTabs
component. Note that @Body is not required at this case.
@inherits LayoutComponentBase
<div class="page">
<div class="sidebar">
<NavMenu />
</div>
<div class="main">
- <div class="top-row px-4">
- <a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a>
- </div>
- <div class="content px-4">
- @Body
- </div>
+ <AntDesign.ReuseTabs Class="top-row px-4" TabPaneClass="content px-4" / >
</div>
</div>
If it's just text, you can use the ReuseTabsPageTitle
attribute.
@page "/counter"
+ @attribute [ReuseTabsPageTitle("Counter")]
If you want to use a template, then implement the IReuseTabsPage interface and implement the method
@page "/"
+ @implements IReuseTabsPage
<h1>Hello, world!</h1>
@code{
+ public RenderFragment GetPageTitle() =>
+ @<div>
+ <Icon Type="home"/> Home
+ </div>
+ ;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。