可以使用 Blazor 的 @bind 绑定属性来实现服务器端更新 UI InputSelect 的功能,如下所示:
@code {
private string selectedOption = "1";
}
@code {
private string selectedOption = "1";
private void UpdateSelectedOption()
{
selectedOption = "3"; // 更新绑定的变量的值
}
}