簡體   English   中英

使用 mat-tab 時不顯示標簽

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

我正在嘗試使用 angular 材料mat-tab-group來創建一個簡單的選項卡視圖。

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>

在此處輸入圖像描述

在此處輸入圖像描述

標簽不可見。

我在這里做錯了什么?

你的代碼是真的我認為你改變了.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