- 文本框逐字搜索
<Bootstrap Blazorclass="table-toolbar-search" placeholder="@SearchPlaceholderText" @onkeyup="OnSearchKeyUp" @bind-Value="@SearchText">
</BootstrapInput>
@code{
private async Task OnSearchKeyUp(KeyboardEventArgs args)
{
if (args.Key == "Enter")
{
await SearchClick();
}
else if (args.Key == "Escape")
{
await ClearSearchClick();
}
}
}