【发布时间】:2021-03-11 15:28:43
【问题描述】:
所以,我有一个垫子标签组,用户可以在其中动态添加标签。
<mat-tab-group class="main-tab-group mt-2" [selectedIndex]="selectedTab" (selectedTabChange)="tabChanged($event)">
<mat-tab *ngFor="let tab of tabs; let tabIndex = index">
<ng-template mat-tab-label>{{ tab.title }}
<i class="material-icons" (click)="removeTab(tabIndex)">close</i>
</ng-template>
<div>
<app-tab-content [tab]="tab"></app-tab-content>
</div>
</mat-tab>
<mat-tab disabled>
<ng-template mat-tab-label>
<button mat-stroked-button (click)="addNewTab()">Add new tab</button>
</ng-template>
</mat-tab>
</mat-tab-group>
代码运行良好,但我需要知道是否有办法在发生这种情况时将新选项卡放在第二行:
【问题讨论】: