其他分享
首页 > 其他分享> > 【thymeleaf】th:with

【thymeleaf】th:with

作者:互联网

前言

th:with

th:with用于定义局部变量。其作用范围在其所在标签或者子标签中有效。

th:with定义的局部变量在其所在标签中使用

Hello , <span th:width="name='jack'" th:text="${name}" class="na"></span> :

th:with定义的局部变量在子标签中使用

<ul th:with="liSize=5">
	<li th:each="index : ${#numbers.sequence(1, liSize)}" >
		[(${index})]. some thing
	</li>
</ul>

标签:index,定义,标签,所在,局部变量,thymeleaf,th
来源: https://blog.csdn.net/sayyy/article/details/120107828