doc: 增加SubNavItemLink公用视图

This commit is contained in:
Argo Zhang 2019-08-16 22:04:14 +08:00
parent 290a41427c
commit ff635952b8
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 18 additions and 11 deletions

View File

@ -1,21 +1,22 @@
@model Bootstrap.Security.BootstrapMenu
@if(Model.Menus.Any())
{
<li class="nav-item has-treeview">
<a href="@Url.Content(Model.Url)" class="nav-link @Model.Active" target="@Model.Target"><i class="@Model.Icon"></i><span class="flex-fill">@Model.Name</span><i class="fa fa-angle-left"></i></a>
@if (Model.Menus.Any())
if(@Model.Active == "active")
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}
<li class="nav-item has-treeview menu-open">
@await Html.PartialAsync("SubNavItemLink", Model)
</li>
}
else
{
<li class="nav-item has-treeview">
@await Html.PartialAsync("SubNavItemLink", Model)
</li>
}
}
else
{
<li class="nav-item">
<a href="@Url.Content(Model.Url)" class="nav-link @Model.Active" target="@Model.Target"><i class="@Model.Icon"></i><span class="flex-fill">@Model.Name</span></a>
@if (Model.Menus.Any())
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}
</li>
}

View File

@ -0,0 +1,6 @@
@model Bootstrap.Security.BootstrapMenu
<a href="@Url.Content(Model.Url)" class="nav-link @Model.Active" target="@Model.Target"><i class="@Model.Icon"></i><span class="flex-fill">@Model.Name</span><i class="fa fa-angle-left"></i></a>
@if (Model.Menus.Any())
{
@await Html.PartialAsync("SubNavigation", Model.Menus)
}