这是我的类,我有一个布尔参数(在服务器端)
public class ChassisDataInfo
{
public string ChassisNo { get; set; }
public string model { get; set; }
public string type { get; set; }
public bool warranty { get; set; }
}
在客户端,我将它绑定到 TextEdit,因为我想向客户端显示一个字符串。我的意思是当我在 ChassisNumber 字段上输入数字时,保修应该填写,但例如在字符串中必须写为“它有”
<Field>
<TextEdit Placeholder="ChassisNumber" @bind-Text="ChassisNo"></TextEdit>
<FieldLabel>warranty </FieldLabel>
<TextEdit Text="@chassis.warranty.ToString()" Disabled="true"> </TextEdit>
<Button Color="Color.Primary" @onclick="@SearchChassis"> <Icon Name="IconName.Search">
</Icon> </Button>
</Field>
Code{
ChassisDataInfo chassis = new ChassisDataInfo();
async Task SearchChassis()
{
chassis = await claim.GetChassisData(ChassisNo);
}
}