Thymeleaf常用标签

select

<select name="pAvailable" class="form-control m-b" required>
  <option th:selected="*{pAvailable eq 'Y'}" value="Y">可用</option>
  <option th:selected="*{pAvailable eq 'N'}" value="N">禁用</option>
</select>
<select name="pBelong" class="form-control m-b" th:with="type=${@dict.getType('belong')}" required>
  <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{pBelong}"></option>
</select>   //RUOYI
<select style="height: 30px;" id="pubChannel" th:with="type=${@contPublishConfigServiceImpl.selectContPublishConfigListForC2button('album')}">   //直接调取后台service方法
  <option value="">请选择</option>
  <option th:each="contPublishConfig : ${type}" th:text="${contPublishConfig.pubName}" th:value="${contPublishConfig.pubChannel}"></option>
</select>

待续...

原文地址:https://www.cnblogs.com/julian-chang/p/11907087.html