简体   繁体   English

如何在HTML中使用百里香替换文本

[英]how to use thymeleaf replace text in html

how to use thymeleaf replace text in html 如何在HTML中使用百里香替换文本

i have tried 我努力了

<a><i class="fa fa-home" th:text="${menuItem.name}" ></i>  <span class="fa fa-chevron-down"></span>

then get result 然后得到结果

<a><i class="fa fa-home">Menu</i>  <span class="fa fa-chevron-down"></span></a>

i want get result like: 我想要得到这样的结果:

<a><i class="fa fa-home"></i> Home <span class="fa fa-chevron-down"></span>
<a><i class="fa fa-home"></i> [[${menuItem.name}]] <span class="fa fa-chevron-down"></span>

要么

<a><i class="fa fa-home"></i> <span th:text="${menuItem.name}" th:remove="tag"> Menu Item</span> <span class="fa fa-chevron-down"></span>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM