我正在使用laravel 5尝试SB Admin 2模板。它工作正常。侧栏菜单除了在每次加载时扩展和折叠第二级和第三级。我不确定是否可以在此处链接演示,但可以在他们的demo
中看到有没有人为此烦恼过,也许找到了解决办法?我希望菜单加载折叠。现在它在每次重装时看起来都很麻烦。
编辑:如果有帮助,我添加了标记 标记
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav nav-collapse">
<ul class="nav" id="side-menu">
<li class="sidebar-search">
<div class="input-group custom-search-form">
<input type="text" class="form-control" placeholder="Quick search...">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
<i class="fa fa-search"></i>
</button>
</span>
</div>
<!-- /input-group -->
</li>
<li>
<a href="#"><i class="fa fa-cog fa-fw"></i> Settings<span
class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li>
<a href="{{ url ('companies') }}"><i class="fa fa-building fa-fw"></i> Companies</a>
</li>
<li>
<a href="{{ url ('users') }}"><i class="fa fa-users fa-fw"></i> Users</a>
</li>
</ul>
</li>
<li>
<a href="#"><i class="fa fa-sitemap fa-fw"></i> SHOP<span
class="fa arrow"></span></a>
<ul class="nav nav-second-level">
<li><a href="{{ url ('products') }}"></i>ALL PRODUCTS</a></li>
<li>
<a href="#"><i class="fa fa-gift fa-fw"></i>CORPO</a>
</li>
<li><a href="#"><i class="fa fa-plus fa-fw"></i> DECO<span
class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="#">Helios</a>
</li>
<li>
<a href="#">Deco</a>
</li>
<li>
<a href="#">Chromos</a>
</li>
<li>
<a href="#">Belinka</a>
</li>
<li>
<a href="#">Fritze Lacke</a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-plus fa-fw"></i> CAR REFINISH<span
class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="#">Helios Refinish</a>
</li>
<li>
<a href="#">Mobihel</a>
</li>
<li>
<a href="#">Chromind</a>
</li>
<li>
<a href="#">Radex</a>
</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-plus fa-fw"></i> INDUSTRY<span
class="fa arrow"></span></a>
<ul class="nav nav-third-level">
<li>
<a href="#">Metal</a>
</li>
<li>
<a href="#">Resins</a>
</li>
<li>
<a href="#">Belinka Perkemija</a>
</li>
<li>
<a href="#">Kemostik</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<!-- /.sidebar-collapse -->
</div>
答案 0 :(得分:2)
之前我遇到过这个问题,请确保侧边栏的列表<li>
内没有内联CSS。或者如果您的默认类别为“活动”。删除这些将解决您的问题。
否则,在每个可折叠的<ul>
(带有类nav.nav级别的ul)中添加此类折叠示例:<ul class="nav nav-second-level collapse">