在 mat-tab-group 中的 mat-tab-header 标签中添加一个 CSS 类(例如 "mat-tab-header-custom"),并使用以下代码来实现每个选项卡的等高:
.mat-tab-header-custom { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; height: 50px; /或者auto/ }
.mat-tab-header-custom .mat-tab-label { flex: 1 1 0; min-width: 0; height: 100%; display: flex; justify-content: center; align-items: center; }
.mat-tab-header-custom .mat-ink-bar { bottom: 6px; }
要解决具体的问题,只需要在 mat-tab-group 标签内添加这个 CSS 样式类即可。