使用thymeleaf模版根据一个数字实现循环

需求:使用thymeleaf模版 根据一个数字在页面循环生成固定的标签html 解决方案:须要用到thymeleaf 的#numbers.sequence()函数函数 示例:spa <span th:each="${i:#numbers.sequence(1, 5)}"> <span th:text="${i}"></span> </span> 效果以下:code 1 2 3 4 5
相关文章
相关标签/搜索