thymeleaf 标签的使用


1.html页面 

2.th:each使用实例

<div class="col-sm-2">
<select id="vehiclesFormalities" class="form-control" title="请选择">
<option value="">请选择</option>
<option th:each="item,itemStat : ${vehiclesFormalitiesEnum}" th:value="${item.code}" th:text="${item.name}"></option>
</select>
</div>

3.
th:text标签使用实例
<tr>
<td class="text-center tdClass" th:text = "${model?.vinNo}">
</td>
<td class="text-center tdClass" th:text="${model.brandName +' | '+model.carSeriesName +' | '+ model.vehicleModelName +' | ' + model.color}">
</td>
</tr>
4.input标签也用value 不用text
5.简单数据转换(数字,日期)product.price 不能写成product?.price
感谢 https://blog.csdn.net/qwlzxx/article/details/70976509

   <dd th:text="${#numbers.formatDecimal(product.price, 1, 2)}">180</dd>
   <dd th:text="${#dates.format(product.availableFrom, 'yyyy-MM-dd')}">2014-12-01</dd>

 


  





免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM