使用Thymeleaf在当前HTML中包含元素

时间:2016-10-09 20:41:35

标签: spring-boot thymeleaf

是否可以在Thymeleaf的当前HTML中包含一个元素:

<span id="el">Rouro</span>
<h2 th:text="|${elo.mimo} nakuru: |" th:include="this :: el"> --- </h2>

1 个答案:

答案 0 :(得分:0)

这不是您问题的确切答案,但可以通过以下代码实现所需的功能:

<span id="el">Rouro</span>
<h2><th:block th:text="|${elo.mimo} nakuru: |" /><th:block th:include="this :: el" /></h2>