前台:
html
通过 <option th:each="chapterList,chapterStat : ${chapterlist}" >
遍历显示的内容,并设置value
如:th:value="${chapterList.chapterId}"
采用th:text="${chapterList.chapterId}+'.'+${chapterList.chapterName}"
显示内容
综上如下HTML代码
<select id="chapterId" name="chapterId">
<option id="getChapterId" value="0" th:text="请选择..."></option>
<option value="-1">全部</option>
<option th:each="chapterList,chapterStat : ${chapterlist}" th:value="${chapterList.chapterId}" th:id=