thymeleaf
【一】三元運(yùn)算符
select中:
<select class="form-control" id="mt" name="noticetype"><option value="0">--請(qǐng)選擇--</option><option th:each = "noticetype : ${noticetypeList}" th:selected="${noticetype.id} eq ${noticemodel.noticetype} ? true : false" th:value = "${noticetype.id}"><span th:text="${noticetype.name}"></span></option></select>class中
<a href="/" th:class="@{(${category} eq 'home' ? 'active-class' : '')}" class="active-class">首頁(yè)</a>text中
<td th:text="${bidAnnounceDO.f eq 1 ? '已發(fā)布' : '未發(fā)布'"}></td> //如果有多個(gè)用()括起來(lái),如: <td th:text="${bidAnnounceDO.f eq 1 ? '已發(fā)布' : (${bidAnnounceDO.f} eq 2 ? '考慮中' : '未發(fā)布''')}"></td>【二】多條件判斷
th:if="${bidSuppreDO.result eq 0 && bidSuppreDO.f eq 0}"【三】關(guān)系運(yùn)算符
gt:great than(大于)>ge:great equal(大于等于)>=eq:equal(等于)==lt:less than(小于)<le:less equal(小于等于)<=ne:not equal(不等于)!=總結(jié)
- 上一篇: bind()、call()、apply(
- 下一篇: Python Web框架学习【Flask