用thymeleaf用标签给页面select下拉框赋值怎么实现
1个回答
展开全部
<select th:field="*{paymentMethod}" th:remove="all-but-first">
<option th:each="paymentMethod : ${paymentMethods}"
th:value="${paymentMethod}" th:text="${paymentMethod.description}">Credit card</option>
<option>Another payment method</option>
<option>Another payment method</option>
</select>
<option th:each="paymentMethod : ${paymentMethods}"
th:value="${paymentMethod}" th:text="${paymentMethod.description}">Credit card</option>
<option>Another payment method</option>
<option>Another payment method</option>
</select>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询