<InputNumber readonly
id="ProductShares"
class="form-control"
placeholder="Product Shares"
oninput="@Calculation"
@bind-Value="product.ProductShares" />
我想InputNumber在代码中更新为只读。那是在oninput我正在调用Calculation方法并且我想以编程方式更新readonly属性的事件上。
public async void Calculation(ChangeEventArgs e)
{
// Something like
if(condition)
{
ProductShares.readonly = true; // ProductShares is the id of the InputNumber
}
else
{
ProductShares.readonly = false;
}
}