【thymeleaf】th:with

2021/9/5 6:09:31

本文主要是介绍【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>


这篇关于【thymeleaf】th:with的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程