Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module:tabs): repeat rendering the TabBarExtra when used nested tabs #489

Merged
merged 1 commit into from
Nov 4, 2017

Conversation

hsuanxyz
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[X] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #452

What is the new behavior?

added [nzTabBarExtraTemplate] property to make #nzTabBarExtraContent optional

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

@hsuanxyz
Copy link
Member Author

new API

    <nz-tabset>
      <nz-tab>
        <ng-template #nzTabHeading>
          Tab1
        </ng-template>
        <nz-tabset [nzTabBarExtraTemplate]="tabBarExtraContent">
        <!--       ^^^^^^^^^^^^^^^^^^^^^^^                  -->
          <nz-tab>
            <ng-template #nzTabHeading>
              SubTab1
            </ng-template>
            <span>SubContent1</span>
          </nz-tab>
          <nz-tab>
            <ng-template #nzTabHeading>
              SubTab2
            </ng-template>
            <span>SubContent2</span>
          </nz-tab>
          <ng-template  #tabBarExtraContent>
            <i class="ant-tabs-new-tab anticon anticon-plus"></i>
          </ng-template>
        </nz-tabset>
      </nz-tab>
      <nz-tab>
        <ng-template #nzTabHeading>
          Tab2
        </ng-template>
        <span>Content2</span>
      </nz-tab>
    </nz-tabset>

downward compatibility

    <nz-tabset [nzType]="'card'">
      <nz-tab *ngFor="let tab of tabs">
        <ng-template #nzTabHeading>
          <div>
            {{tab.name}}
            <i class="anticon anticon-cross" (click)="closeTab(tab)"></i>
          </div>
        </ng-template>
        <span>Content of {{tab.name}}</span>
      </nz-tab>
      <ng-template #nzTabBarExtraContent>
        <i class="ant-tabs-new-tab anticon anticon-plus"></i>
      </ng-template>
    </nz-tabset>

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 41.247% when pulling 6394981 on HsuanXyz:fix-tab into 4efd6f7 on NG-ZORRO:master.

@vthinkxie vthinkxie merged commit 3289e7f into NG-ZORRO:master Nov 4, 2017
@hsuanxyz hsuanxyz deleted the fix-tab branch December 6, 2017 11:33
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants