matDatepicker 的布局和功能无法正常工作
Layout and functionality of matDatepicker does not work correctly
我就是想不通我忘了连接什么。但最后我有一个无法使用的日期选择器
"@angular/material": "^9.2.3"
<mat-form-field>
<mat-label>Choose a date</mat-label>
<input matInput [matDatepicker]="picker">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
import { MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
MatToolbarModule,
MatDialogModule,
BrowserAnimationsModule,
MatIconModule,
MatDatepickerModule,
MatNativeDateModule,
MatFormFieldModule,
ReactiveFormsModule,
MatInputModule
]
@import "~@angular/material/prebuilt-themes/indigo-pink.css";在 style.css
我就是想不通我忘了连接什么。但最后我有一个无法使用的日期选择器
"@angular/material": "^9.2.3"
<mat-form-field>
<mat-label>Choose a date</mat-label>
<input matInput [matDatepicker]="picker">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
import { MatNativeDateModule } from '@angular/material/core';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
HttpClientModule,
MatToolbarModule,
MatDialogModule,
BrowserAnimationsModule,
MatIconModule,
MatDatepickerModule,
MatNativeDateModule,
MatFormFieldModule,
ReactiveFormsModule,
MatInputModule
]
@import "~@angular/material/prebuilt-themes/indigo-pink.css";在 style.css