我正在嘗試 th:text 在我的 div 中,但它似乎不起作用
我試著用一張表來做,我得到了我需要的資料,但是當我把它放在一個 div 中時它不起作用
<div class="info" data-th-each="shoes: ${shoesList}">
<p th:text="$(shoes.name)"></p>
<p th:text="$(shoes.description)"></p>
<p th:text="$(shoes.price)"></p>
</div>
這行得通
<table>
<tr data-th-each="shoes : ${shoesList}">
<td th:text="${shoes.name}"></td>
<td th:text="${shoes.description}"></td>
<td th:text="${shoes.price}"></td>
</tr>
</table>
uj5u.com熱心網友回復:
我認為,它將遵循以下方式(正確的 $(shoes.name) 到 ${shoes.name} )
<div class="info" th:each="shoes : ${shoesList}">
<p th:text="${shoes.name}"></p>
<p th:text="${shoes.description}"></p>
<p th:text="${shoes.price}"></p>
</div>
請訪問此鏈接 迭代百里香葉
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/397761.html
