首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Thymeleaf方言中的Thymeleaf方言

Thymeleaf方言中的Thymeleaf方言
EN

Stack Overflow用户
提问于 2016-10-09 19:19:22
回答 1查看 140关注 0票数 1

我想在Thymeleaf方言中使用Thymeleaf方言,但没有。我试过了,但也没有用:

代码语言:javascript
复制
<h2 th:text="|${response.name} has: |">
Dunie has: 
    <span th:text="|-${response.size}-|" class="paleo">-4-</span>
</h2>

th:text of h2删除了其中的所有内容。我想在渲染后得到这样的东西:

代码语言:javascript
复制
<h2>
Philie has: 
    <span class="paleo">-3-</span>
</h2>

那么,我该怎么做我的目标呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-10 12:47:18

使用th:块 http://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#synthetic-thblock-tag

代码语言:javascript
复制
<h2>
    <th:block th:text="|${response.name} has: |" />
    <span th:text="|-${response.size}-|" class="paleo"></span>
</h2>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39947566

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档