重构脚本:移除navbar-collapse元素

This commit is contained in:
Argo-MacBookPro 2018-09-17 23:49:29 +08:00
parent e7c458e10a
commit 17c269ee62
1 changed files with 15 additions and 17 deletions

View File

@ -29,25 +29,23 @@
</div> </div>
</div> </div>
<nav class="navbar navbar-expand navbar-light d-none d-md-flex"> <nav class="navbar navbar-expand navbar-light d-none d-md-flex">
<div class="collapse navbar-collapse" id="navMenu"> <div class="navbar-nav">
<div class="navbar-nav"> @foreach (var menu in Model.Navigations)
@foreach (var menu in Model.Navigations) {
@if (menu.Menus.Count() > 0)
{ {
@if (menu.Menus.Count() > 0) <div class="nav-item dropdown @menu.Active">
{ <a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" href="#">@menu.Name</a>
<div class="nav-item dropdown @menu.Active"> @await Html.PartialAsync("Menu", menu.Menus)
<a class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" href="#">@menu.Name</a> </div>
@await Html.PartialAsync("Menu", menu.Menus)
</div>
}
else
{
<div class="nav-item @menu.Active">
<a class="nav-link" target="@menu.Target" href="@Url.Content(menu.Url)">@menu.Name</a>
</div>
}
} }
</div> else
{
<div class="nav-item @menu.Active">
<a class="nav-link" target="@menu.Target" href="@Url.Content(menu.Url)">@menu.Name</a>
</div>
}
}
</div> </div>
</nav> </nav>
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">