thymeleaf用法记录

参考链接:https://www.cnblogs.com/topwill/p/7434955.html

1、基本循环

<tr th:each="prod : ${prods}">

     <td th:text="${prod.name}">Onions</td>
     <td th:text="${prod.price}">2.41</td>
     <td th:text="${prod.inStock}? #{true} : #{false}">yes</td>
</tr>

2、th:href用法

 <a data-toggle="collapse" th:href="@{'tabs_panels.html#'+${attrGroup.name}}" th:text="${attrGroup.name}"></a>

猜你喜欢

转载自www.cnblogs.com/webttt/p/11572318.html
今日推荐