可以使用th:remove标签来删除th:each标签本身,例如:

<div th:remove="all">
   <ul>
      <li th:each="item : ${items}" th:text="${item}"></li>
   </ul>
</div>

在这个例子中,th:remove="all"会将整个

标签及其子元素从最终的HTML中移除,只保留th:each标签内部的
  • 标签和其内容。

    thymeleaf在theach时不要保留本身的标签怎么做

  • 原文地址: https://www.cveoy.top/t/topic/dFUB 著作权归作者所有。请勿转载和采集!

    免费AI点我,无需注册和登录