简体   繁体   English

使用 mat-tab 时不显示标签

[英]Labels are not displayed while using mat-tab

I am trying to have a simple tab view using angular material mat-tab-group .我正在尝试使用 angular 材料mat-tab-group来创建一个简单的选项卡视图。

app.module.ts and app.component.html file - app.module.tsapp.component.html文件 -

 import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatTabsModule} from '@angular/material/tabs'; import { FormsModule } from '@angular/forms'; import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, BrowserAnimationsModule, MatToolbarModule, MatTabsModule, MatProgressSpinnerModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
 <mat-toolbar color="primary"> <span>Your financial portfolio</span> </mat-toolbar> <div> <mat-tab-group> <mat-tab label="First">Content 1</mat-tab> <mat-tab label="Second">Content 2</mat-tab> <mat-tab label="Third">Content 3</mat-tab> </mat-tab-group> </div>

在此处输入图像描述

在此处输入图像描述

Labels are not visible.标签不可见。

What am I doing wrong here?我在这里做错了什么?

your code is true I think you changed color of .mat-tab-label, .mat-tab-link then test this in .css file:你的代码是真的我认为你改变了.mat-tab-label, .mat-tab-link颜色然后在.css文件中测试这个:

 .mat-tab-label, .mat-tab-link { color: rgba(0,0,0,.87);important; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM