【发布时间】:2021-06-27 17:00:36
【问题描述】:
我正在尝试更改禁用输入的字体颜色。由于禁用时它是灰色的,我希望它显示为黑色。因此,我尝试使用只读,但它不起作用,现在输入没有显示它应该显示的内容。它只是说[对象对象]。这是我的 HTML 和 TS 代码。可能是什么问题?
HTML 代码:
<mat-form-field appearance="outline" fxFlex="50" class="pr-4">
<mat-label>Producer</mat-label>
<input matInput formControlName="Producer" readonly="readonly">
<mat-icon matSuffix class="disabled-text">short_text</mat-icon>
<mat-error>Producer is Mandatory!</mat-error>
</mat-form-field>
TS 代码:
Producer: new FormControl(
{
value:
this.order.ProducerSellerCode +
"-" +
this.order.ProducerSellerName,
readonly: true,
},
[Validators.required]
),
【问题讨论】:
-
你能分享你的css吗?
标签: javascript html css angular typescript