thymeleaf的写法和EL表达式的写法是有些类似的,总的说thymeleaf的写法更好:
官网doc:https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#simple-conditionals-if-and-unless
<td th:text="${#dates.format(i.startdate,'yyyy-MM-dd')}"></td>
<tr th:each="i:${list}">
<td th:text="${i.id}"></td>
<td th:text="${i.projectname}"></td>
<td th:text="${#dates.format(i.startdate,'yyyy-MM-dd')}"></td>
<td th:text="${#dates.format(i.enddate,'yyyy-MM-dd')}">
</td>
<td th:if="${i.status eq 1}">已申报</td>
<td th:if="${i.status eq 2}">审核中</td>
<td th:if="${i.status eq 3}">已审核</td>
<td th:if="${i.status ne 3}">
<a th:href="@{'getOne/'+${i.id}}">审核</a>
</td>
<td th:if="${i.status eq 3}">已审核</td>
</tr>