<div class="showing">
<h2>條件判斷</h2>
<p th:if="${testBoolean}" >如果testBoolean 是 true ,本句話就會顯示</p>
<p th:if="${not testBoolean}" >取反 ,所以如果testBoolean 是 true ,本句話就不會顯示</p>
<p th:unless="${testBoolean}" >unless 等同於上一句,所以如果testBoolean 是 true ,本句話就不會顯示</p>
<p th:text="${testBoolean}?'當testBoolean為真的時候,顯示本句話,這是用三相表達式做的':''" ></p>
</div>
————————————————
版權聲明:本文為CSDN博主「日G一卒」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/likunpeng6656201/article/details/99442692