小编Cyr*_*ghe的帖子

ThymeLeaf中的条件文本:如何以纯文本形式进行?

我理解如何:如果适用于html模板,但我没有找到任何关于如何做到这一点的线索当你期望纯文本(用例:纯文本电子邮件模板).

到目前为止我试过:

<html xmlns:th="http://www.thymeleaf.org" th:inline="text" th:remove="tag">
  Dear [[${contact.firstname}]] [[${contact.lastname}]],
  An alert was triggered at location:  [[${account.address}]] 
  <span th:if=\"${videoLink}\">To view your security camera recordings, please click on [[${videoLink]]</span>
</html>
Run Code Online (Sandbox Code Playgroud)

它有效...但结果包含标签.我知道我做错了什么?

谢谢,西里尔

if-statement plaintext thymeleaf

3
推荐指数
1
解决办法
4384
查看次数

标签 统计

if-statement ×1

plaintext ×1

thymeleaf ×1