首页 > 代码库 > Thymeleaf-语法整理

Thymeleaf-语法整理

Thymeleaf其他案例看其他网站

http://www.cnblogs.com/hjwublog/p/5051732.html

http://blog.csdn.net/u012706811/article/details/52185345

 

本例为详细对某些使用记录

1.list循环案例

  a:th:each

在某个标签上加上th:each,带着标签循环,如果实在是不知道用什么标签,就直接用th:block代替

<th:block th:each="d,index:${listTransfeStages}">
    <button type="button" class="btn btn-default nqs-label-btn"><span th:text="${d.etsName}"></span></button>
</th:block>

 

 

2.数字在页面递减循环

#numbers.sequence函数进行计算,例中为从1开始到page.totalPages结束(含)
<li th:each="i:${#numbers.sequence(1,page.totalPages)}">
    <a href="#" th:text="${i}"></a>
</li>

 

Thymeleaf-语法整理