【Thymeleaf】Thymeleaf 实战小技巧

1、Thymeleaf 实战小技巧

记录工作中的小技巧

(1)基础运算符

lt:less than 小于
le:less than or equal to 小于等于
eq:equal to 等于
ne:not equal to 不等于
ge:greater than or equal to 大于等于
gt:greater than 大于
not: 非运算
mod: 取模
and: 与运算
or: 或运算

(2)List 非空判断

等于0
th:if="${#lists.size(appInfoFormList)} eq 0"

大于0
<div class="xfr-content-null" th:if="${#lists.size(listGroup)} eq 0">
    <img src="/static/img/plan.png">
    <p>暂无数据</p>
</div>

(3)时间格式化

${#dates.format(entity.crateTime, 'yyyy-MM-dd hh:mm:ss')}

微信公众号

每天Get一个小技巧

猜你喜欢

转载自blog.csdn.net/qq_38762237/article/details/110132069