thymeleaf 遍历

Smallstone丶 2018-05-17 11:58:39
<div class="col-md-4 column"  th:each="book:${books}">
<h2>
<b class="book-cover-shadow" ></b>
<img width="125" height="165" style=" background-image: url(${book.url}), url(img/backdrop.png); border-radius:13px; background-size:125px auto; background-blend-mode: multiply;" src="img/book.png" />
</h2>
<p align="center">
作者: <a href="#" th:text="${book.author}" ></a>
<br/>
书籍名称:<a href="#" th:text="${book.bookName}" ></a>
<br/>
书籍类型:
<span th:each="st:${sortTypes}" >
<a href="#" th:if="${st.id == book.sortTypeId}" th:text="${st.name}"></a>
</span>
<br/>
</p>
<p>
<span style="color: #f77a36;">¥13.50</span>
<button type="button" class="btn btn-default" >购买</button>
</p>
</div>


<img width="125" height="165" style=" background-image: url(${book.url}), url(img/backdrop.png); border-radius:13px; background-size:125px auto; background-blend-mode: multiply;" src="img/book.png" />

我这里的: ${book.url} 我想直接遍历内容不是用什么th:xx标签行吗
...全文
887 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
烛火未明 2018-05-19
  • 打赏
  • 举报
回复
可以 自己拼起来

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧