<div th:each="s:${shops}" >
<div th:id="${s.id}" onclick="shopDetail(this.id)">
<div>
<img th:src="@{${s.shopImgs}}">
</div>
<div >
<span th:text="@{${s.shopName}}" class="shopname" ></span>
<span>¥
<span th:text="@{${s.shopMoney}}"></span>
</span>
</div>
</div>
</div>
th:each="s:${shops}" ,shops是从后台获取的内容,th:id="${s.id}"是为div绑定id,值是循环后从s中获取到的id值。
th:src="@{${s.shopImgs}}"是图片的url.
th:text="@{${s.shopName}}"是显示的文本内容