1 Star 3 Fork 0

Ant Design Blazor/demo-reuse-tabs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

ReuseTabs

A reuse tabs demo for Ant Design Blazor.

Demo

https://antblazor.com/demo-reuse-tabs/

ScreenShot

demo

How to use

Prerequisites

Follow the installation steps of AntDesign and install the AntDeisgn dependencies.

Basic case

  1. First of all, create a blazor project using dotnet new command.

  2. 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>
    
    
  3. 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>
    
    

Customize tab title

  • 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>
    +   ;
    }
    

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ant-design-blazor/demo-reuse-tabs.git
git@gitee.com:ant-design-blazor/demo-reuse-tabs.git
ant-design-blazor
demo-reuse-tabs
demo-reuse-tabs
master

搜索帮助