I'm using the Blazor template which using the NavLink component. This wraps up the bootstrap menu so it's basically bootstrap underneath.
I am trying to create a blazor navmenu which has a shape like this
when I click on item b it expands with sub menu like this and clicking on subitems, new pages open
Do not use the data-toggle and data-target for it.
These are used by boostrap.js however you do not want to modify the DOM in that way.
Blazor template with menu across the top,If you open NavMenu.razor you'll see it's just a Bootstrap Navbar, for this specific Explorer-like layout - a vertical navbar on the left, the main area on the right.
The NavLink components is just a <a> tag but with services to update its css class.
What you do instead is to use an if statement and thus let Blazor take care of the rendering:
And put the expandSubNav field into your code section:
.Net 8.x
step 1. NavMenu.razor
search expandSubNav in github
Blazor nav menu horizontal
https://www.xspdf.com/resolution/58914389.html
Blazor Collapse with multi submenus
https://forums.asp.net/t/2168463.aspx?Blazor+Collapse+submenus