MatTabNavBar 未显示箭头 [英] MatTabNavBar not showing arrows
问题描述
我注意到 MatTabNavBar 与常规 MatTabGroup 的行为不同,如果容器对于选项卡来说太小,则显示箭头时.
I've noticed that the MatTabNavBar is behaving different from a regular MatTabGroup when it comes to showing the arrows if the container gets too small for the tabs.
我使用官方文档构建了 MatTabNavBar 和 MatTabGroup,但您可以在这里看到 MatTabGroup 显示箭头而 MatTabNavBar 没有.
I used the official documentation to build the MatTabNavBar and MatTabGroup, but you can see here that the MatTabGroup is showing arrows and the MatTabNavBar is not.
https://angular-gaio5u.stackblitz.io
用于 MatTabGroup 的模板:
Template used for MatTabGroup:
<mat-tab-group>
<mat-tab
*ngFor="let tab of tabs"
[label]="tab.label"
>
{{ tab.label }}
</mat-tab>
</mat-tab-group>
用于 MatTabNavBar 的模板:
Template used for MatTabNavBar:
<nav mat-tab-nav-bar>
<a
mat-tab-link
*ngFor="let tab of tabs"
[active]="isActive(tab)"
(click)="setActive(tab)"
>
{{ tab.label }}
</a>
</nav>
...所以我错过了什么吗?!预期结果是 MatTabNavBar 显示与 MatTabGroup 相同的箭头.
...so am I missing anything?! The expected result is the MatTabNavBar showing the same arrows as MatTabGroup.
推荐答案
仅供参考,这似乎在 @angular/material@8.2.x
和更新版本中已修复.
FYI, this seems to be fixed in versions @angular/material@8.2.x
and newer.
这篇关于MatTabNavBar 未显示箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!