你可以这样做,你可以根据你的要求设置
IsDisabled
。
@code{
protected bool IsDisabled { get; set; }
}
<InputText class="@("cursor-disabled "+ input100)" disabled="@IsDisabled" name="addressLine1" placeholder="County Code..." @bind-Value="_model.CountyCode" />
只需使用经典的 HTML 标签
<input>
并添加 readonly
(但不是 readonly="true")
<input type="text" class="@("cursor-disabled "+ input100)" id="addressLine1" name="addressLine1" placeholder="County Code..." @bind-Value="_model.CountyCode" readonly />