iwiki
2020-01-03 08:49:59 +08:00
<!-- 菜单递归 -->
<th:block th:fragment="listmenu(menus)">
<th:block th:each="menu : ${menus}">
<th:block th:if="${menu.getMenus().size()>0}">
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
<span th:text="${menu.getName()}"></span>
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<th:block th:include="this::listmenu(${menu.getMenus()})"/>
</ul>
</li>
</th:block>
<th:block th:if="${menu.getMenus().size()==0}">
<li class="nav-item">
<a href="#" th:href="${menu.getUri()}" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p th:text="${menu.getName()}"></p>
</a>
</li>
</th:block>
</th:block>
</th:block>
参考这个吧,函数传值