字符串拼接
拼接字符串通过 + 或者 | 进行拼接
th:text="
a
+
{a}+
a+{b}">
th:text="|${a} ${b}|">
<select name="docId" id="docId" lay-search>
<option th:each="doctor:${doctor}"
th:text="${doctor.docName} + '('+${doctor.hospital} +')'" th:value="${doctor.id}"></option>
</select>
thymeleaf th:value 可以使用+号拼接两个字符串
<label th:each="brand:${brands}" class="check-box">
<input id="brands" name="brands" type="checkbox" th:value="${brand.brandId}+','+${brand.brandShortName}" th:text="${brand.brandShortName}">
</label>