Created
December 28, 2018 13:33
-
-
Save Mirch/2d621490b8988589e1690340f11284f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits BlazorLayoutComponent | |
@inject Microsoft.AspNetCore.Blazor.Services.IUriHelper UriHelper | |
<div class="sidebar"> | |
<NavMenu /> | |
</div> | |
<div class="main"> | |
<div class="top-row px-4"> | |
<input type="search" bind-value-oninput="@SearchTerm" onkeydown="@((e) => SearchKeyDown(e))" placeholder="Search..." /> | |
</div> | |
<div class="content px-4"> | |
@Body | |
</div> | |
</div> | |
@functions { | |
private string SearchTerm { get; set; } | |
private void SearchKeyDown(UIKeyboardEventArgs e) | |
{ | |
if (e.Key == "Enter") | |
{ | |
this.StateHasChanged(); | |
UriHelper.NavigateTo($"/search/{SearchTerm}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment