参考链接: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用法
用法:th:href="@'字符串'+${name}"
<a data-toggle="collapse" th:href="@{'tabs_panels.html#'+${attrGroup.name}}" th:text="${attrGroup.name}"></a>
3、th:onclick用法
<button th:onclick="'javascript:remove('+${attrGroup.id}+')'">删除</button>
参考链接:https://www.jianshu.com/p/622c5f0a0ee1?utm_campaign
4、th:checked
<input name="para-ids" type="checkbox" th:id="${para.id}" th:value="${para.id}" th:checked="${para.selectFlag}"/>
其中selectFlag值为false或true
参考链接:https://www.cnblogs.com/nuoyiamy/p/5591559.html
5、th:include
引用时: <div th:include="system/user/add:: add"></div> 定义时: <div th:fragment="add" ></div>
参考链接:https://blog.csdn.net/believe__sss/article/details/79992408
6、参数为空,加?判断
th:value="${para?.name}"
参考链接:https://bbs.csdn.net/topics/392364154