关于下拉框选中效果,用java模板引擎(thymeleaf)
本人是一名前端,之前没用过thymeleaf,问了一下后端人员他说他也不清楚,我只好通过百度来看别人的分享的代码来进行书写,今天主要是分享一个前端最常用的在编辑中select选中效果的使用
代码如下:
<select name="smallTypeId" id="" class="form-control">
<option selected hidden disabled value="">请选择物料小类</option>
<option th:each="type:${tlMaterialSmallTypeList}" th:value="${type.smallTypeId}" th:text="${type.typeName}" th:field="${tlMaterial.smallTypeId}"></option>
</select>