thymeleaf在theach时不要保留本身的标签怎么做
可以使用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标签内部的标签和其内容。
原文地址: https://www.cveoy.top/t/topic/dFUB 著作权归作者所有。请勿转载和采集!