场景
在使用Thymeleaf进行遍历循环时,数据前面的序号如果使用实体类的id属性,id要是不从1开始递增则不能实现计数效果。
所以需要在循环时实现一个递增的序号效果。
如果没有显示设置状态变量,thymeleaf会默 认给个“变量名+Stat"的状态变量。
实现
<tr th:each="orderlist:${wmsReceiveOrderDetailsVOList}" class="text_al_r">
<td>
<input type="checkbox"
class="ads_Checkbox"
th:text="${orderlistStat.index+1}"
th:value="${orderlist.id}" name="checkedid"/>
</td>
<td th:text="${orderlist.salver