1、常用属性
关键字th属性是Thymeleaf模板提供的。以下是Thymeleaf的常用属性:
| th:标签 | 说明 |
|---|---|
| th:insert | 页面片段包含(类似JSP中的include标签) |
| th:replace | 页面片段包含(类似JSP中的include标签) |
| th:each | 元素遍历(类似JSP中的c:forEach标签) |
| th:if | 条件判断,条件成立时显示th标签的内容 |
| th:unless | 条件判断 |

关键字th属性是Thymeleaf模板提供的。以下是Thymeleaf的常用属性:
| th:标签 | 说明 |
|---|---|
| th:insert | 页面片段包含(类似JSP中的include标签) |
| th:replace | 页面片段包含(类似JSP中的include标签) |
| th:each | 元素遍历(类似JSP中的c:forEach标签) |
| th:if | 条件判断,条件成立时显示th标签的内容 |
| th:unless | 条件判断 |