Created
March 9, 2019 14:45
-
-
Save chrissainty/5553cb35f00fc935e6dd0685be079313 to your computer and use it in GitHub Desktop.
Blazored Menu Idea
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
<BlazoredMenu> | |
<BlazoredMenuItem> | |
<NavLink class="nav-link" href="" Match="NavLinkMatch.All"> | |
<span class="oi oi-home" aria-hidden="true"></span> Home | |
</NavLink> | |
</BlazoredMenuItem> | |
<BlazoredMenuItem> | |
<NavLink class="nav-link" href="counter"> | |
<span class="oi oi-plus" aria-hidden="true"></span> Counter | |
</NavLink> | |
</BlazoredMenuItem> | |
<BlazoredSubMenu Header="Sub Menu"> | |
<BlazoredMenuItem> | |
<NavLink class="nav-link" href="counter"> | |
<span class="oi oi-plus" aria-hidden="true"></span> Counter | |
</NavLink> | |
</BlazoredMenuItem> | |
<BlazoredMenuItem> | |
<NavLink class="nav-link" href="fetchdata"> | |
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data | |
</NavLink> | |
</BlazoredMenuItem> | |
</BlazoredSubMenu> | |
<BlazoredMenuItem> | |
<NavLink class="nav-link" href="fetchdata"> | |
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data | |
</NavLink> | |
</BlazoredMenuItem> | |
</BlazoredMenu> |
I agree, it’s rare my apps have a ‘static’ menu, it’s usually composed based on the user
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an elegant approach. Congrats.
I'm more interested on a dynamic menu. I mean, populate a helper and send helper to a menu component. Something like:
Calling the component:
By the way, I tried to put
<NavLink
into a loop unsuccessfully, at the end I wrote my 'own'NavLink
. The only "complexity" is to know if the item should beactive
(because is a link to the current url). This is my draft:I will be posted to see your code. Regards.