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集合。


持續更新中。。。。。。

發佈了41 篇原創文章 · 獲贊 16 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章