Todo:
错误:“未定义选择器”
<mat-form-field style="width: 100%;">
<input matInput [matDatepicker]="picker" onfocus="picker.open()"
placeholder="Choose a date">
<mat-datepicker-toggle matSuffix [for]="picker">
</mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
但是当我按下按钮时它就起作用了
<button mat-button (click)="picker.open()">show date picker</button>
如何专注于输入
答案 0 :(得分:0)