<select name="classification_id" class="form‐control" >
<option th:selected="${classification['classification_id']== article['classification_id']}" th:value="${classification['classification_id']}" th:each="classification:${classification}" th:text="${classification['classification_name']}"></option>
</select>
selected是选中值, 其中表示遍历时,如果想等, 则选中该值
有一定程度上后端的味道,
但是很省事,不是吗
博客提到selected是选中值,在遍历时若条件相等则选中该值,还指出其有一定后端味道,且使用起来较为省事。
1593

被折叠的 条评论
为什么被折叠?



