如何将 1 添加到 [], th:each, thymeleaf 中的索引?

问题描述

我想表达加1到索引的值。但是将 1 添加到索引在 [ ] 中不起作用。如何将 1 添加到 [ ] 中的索引。我正在使用百里香叶。

<div th:each="dtcInfo,i : ${dtcInfoList}">
    <tr th:if="${i.index} % 2 == 0">
        <td th:if="${dtcInfoList[i.index + 1]}">test</td>
    </tr>
</div>

${dtcInfoList[i.index]} 有效,但 ${dtcInfoList[i.index + 1]} 无效。 如何使用 dtcInfoList[i.index + 1] 的值?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)