在我的 package.json 上有@angular/material": "^13.3.8",但我使用的是 13.3.7 版本和Angular CLI: 13.3.7. 我只是從 Angular Material 復制代碼,并且已經MatInputModule在我的app.module.ts. 我的問題是我的瀏覽器上沒有顯示 mat-form-field。我需要單擊我輸入的區域,然后它會顯示出來。如下圖所示:
在我點擊 mat-form-field 之前

在我點擊 mat-form-field 之后

我怎么解決這個問題?這是我的代碼:
product.component.html
<div class="example-container">
<mat-form-field class="example-full-width" appearance="fill">
<mat-label>Filter</mat-label>
<input matInput placeholder="Search...">
</mat-form-field>
</div>
app.module.ts
BrowserModule,
AppRoutingModule,
NgbModule,
BrowserAnimationsModule,
MatTableModule,
MatCardModule,
MatPaginatorModule,
MatInputModule,
MatIconModule,
MatButtonModule,
FormsModule,
FontAwesomeModule,
MatFormFieldModule,
ReactiveFormsModule
uj5u.com熱心網友回復:
您需要在 style.scss 或 angular.json 樣式陣列中匯入材質樣式。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/482447.html
標籤:有角度的 打字稿 角材料 mat-form-field
