有什么方法可以在 AdminLTE 侧边栏中添加第三级菜单项?
Any way to add a 3rd level menu item in AdminLTE sidebar?
我正在尝试找到一种在我的 AdminLTE (V3.1.0) 门户的侧边栏中设置第 3 级菜单的方法。基本上我正在尝试实现如下目标:
<ul id="sidebarTree" class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="true">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 1 ITEM
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level2item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 2 ITEM/p>
</a>
</li>
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 2 ITEM - EXPANDABLE
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level3item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 3 ITEM/p>
</a>
</li>
</ul>
</ul>
</li>
有人知道如何做到这一点吗?或者这根本可以做到吗?
请参阅此处 (https://adminlte.io/docs/3.1//components/main-sidebar.html),了解边栏在他们的文档中的样子。
是的,这是可能的,您所要做的就是将 class 名称 nav-item
添加到父级 li
。
li > ul {
margin-left: 25px;
}
<link rel="stylesheet" href="https://adminlte.io/docs/3.1//assets/css/adminlte.min.css">
<ul id="sidebarTree" class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="true">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 1 ITEM
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level2item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 2 ITEM</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 2 ITEM - EXPANDABLE
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level3item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 3 ITEM</p>
</a>
</li>
</ul>
</li>
</ul>
</li>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="/docs/3.1//assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="/docs/3.1//assets/js/adminlte.min.js"></script>
注意: Whosebug 在此处限制了一些导入,您可以在下面的我的代码笔中查看它
我正在尝试找到一种在我的 AdminLTE (V3.1.0) 门户的侧边栏中设置第 3 级菜单的方法。基本上我正在尝试实现如下目标:
<ul id="sidebarTree" class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="true">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 1 ITEM
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level2item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 2 ITEM/p>
</a>
</li>
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 2 ITEM - EXPANDABLE
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level3item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 3 ITEM/p>
</a>
</li>
</ul>
</ul>
</li>
有人知道如何做到这一点吗?或者这根本可以做到吗?
请参阅此处 (https://adminlte.io/docs/3.1//components/main-sidebar.html),了解边栏在他们的文档中的样子。
是的,这是可能的,您所要做的就是将 class 名称 nav-item
添加到父级 li
。
li > ul {
margin-left: 25px;
}
<link rel="stylesheet" href="https://adminlte.io/docs/3.1//assets/css/adminlte.min.css">
<ul id="sidebarTree" class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="true">
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 1 ITEM
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level2item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 2 ITEM</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-address-book"></i>
<p>
LEVEL 2 ITEM - EXPANDABLE
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link" id="level3item">
<i class="nav-icon far fa-circle"></i>
<p>LEVEL 3 ITEM</p>
</a>
</li>
</ul>
</li>
</ul>
</li>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="/docs/3.1//assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="/docs/3.1//assets/js/adminlte.min.js"></script>
注意: Whosebug 在此处限制了一些导入,您可以在下面的我的代码笔中查看它