NavMenu.razor 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <div class="top-row pl-4 navbar navbar-dark">
  2. <a class="navbar-brand" href="">Articles</a>
  3. <button class="navbar-toggler" @onclick="ToggleNavMenu">
  4. <span class="navbar-toggler-icon"></span>
  5. </button>
  6. </div>
  7. <div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
  8. <ul class="nav flex-column">
  9. <li class="nav-item px-3">
  10. <NavLink class="nav-link" href="" Match="NavLinkMatch.All">
  11. <span class="oi oi-home" aria-hidden="true"></span> Домой
  12. </NavLink>
  13. </li>
  14. <li class="nav-item px-3">
  15. <NavLink class="nav-link" href="docsupload">
  16. <span class="oi oi-plus" aria-hidden="true"></span> Загрузка
  17. </NavLink>
  18. </li>
  19. <li class="nav-item px-3">
  20. <NavLink class="nav-link" href="fetchdata">
  21. <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
  22. </NavLink>
  23. </li>
  24. </ul>
  25. </div>
  26. @code {
  27. private bool collapseNavMenu = true;
  28. private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
  29. private void ToggleNavMenu()
  30. {
  31. collapseNavMenu = !collapseNavMenu;
  32. }
  33. }