[英]ExpressionChangedAfterItHasBeenCheckedError on Angular 6 while using <mat-tab>
[英]Labels are not displayed while using mat-tab
我正在嘗試使用 angular 材料mat-tab-group
來創建一個簡單的選項卡視圖。
app.module.ts
和app.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.