Thymeleaf 笔记

th:each=”aname : ${namelist}”


th:if=”${name} == ‘SERVICED’”


页面使用Map集合

<div  th:each="osl : ${orderStatusList}" th:if="${osl.key} == 'BOOKED'" class="Title  booked" >
<div class="Point"></div>
预约 <span th:text="${osl.value}" style="position: absolute; bottom: -45px; left: 12px;"></span>
</div>

th:href=”base+/orderdetail/detail/?orderNo=+{order.orderNumber}”


 –内联JS js起止加入如下代码,否则引号嵌套或者”<”“>”等不能用

/*<![CDATA[*/
……
/*]]>*/

  –js附加代码:

/*[+
var msg = 'This is a working application';
+]*/

  –js移除代码:

/*[- */
var msg = 'This is a non-working template';
/* -]*/

select

<select class="form-control" name="filter1" >
                                <option value="">请选择</option>
                                <option th:each="item : ${tofilter}" th:selected="${item==accessory.filter1}" th:value="${item}" th:text="${item}">全部</option>
                            </select> 

tofilter是List集合。


持续更新中。。。。。。

Code is read far more than it's written
原文地址:https://www.cnblogs.com/ChickenTang/p/5655408.html