Thymeleaf删除代码块

时间:2018-08-17 18:31:53

标签: thymeleaf

我使用百里香3和自举4 我有这个代码

<div class="row">
   <div class="col-md-6" th:text="#{summary}">
      Summary
      <ul class="list-group">
         <li class="list-group-item"><span th:text="#{notSpecials}">Not special</span></li>
         <li class="list-group-item"><span th:text="#{specials}">Special</span></li>
         <li class="list-group-item"><span th:text="#{granulate}">Granulate</span></li>
      </ul>
   </div>
   <div class="col-md-6" th:text="#{byTestType}">
      By test type
      <ul class="list-group">
         <li class="list-group-item"><span th:text="#{compressions}">Compressions</span></li>
         <li class="list-group-item"><span th:text="#{absorptions}">Absorptions</span></li>
         <li class="list-group-item"><span th:text="#{durabilityScalings}">Durability  Scaling</span></li>
      </ul>
   </div>
</div>

百里香还给我

<div class="row">
  <div class="col-md-6">Summary</div>
  <div class="col-md-6">By test type</div>
</div>

似乎百里香删除代码。

所有值都正确存在于spring boot的本地化文件中。

1 个答案:

答案 0 :(得分:1)

是因为您的本地化。...将块更改为

             <div class="row">
                  <div class="col-md-6">
                    <span th:text="#{summary}">Summay</span>
                    <ul class="list-group">
                      <li class="list-group-item"><span th:text="#{notSpecials}">Not special</span></li>
                      <li class="list-group-item"><span th:text="#{specials}">Special</span></li>
                      <li class="list-group-item"><span th:text="#{granulate}">Granulate</span></li>
                    </ul>
                  </div>
                  <div class="col-md-6">
                    <span th:text="#{byTestType}">By test type</span>
                    <ul class="list-group">
                      <li class="list-group-item"><span th:text="#{compressions}">Compressions</span></li>
                      <li class="list-group-item"><span th:text="#{absorptions}">Absorptions</span></li>
                      <li class="list-group-item"><span th:text="#{durabilityScalings}">Durability / Scaling</span></li>
                    </ul>
                  </div>
                </div>