使用场景
在商品列表页面,点击商品栏的“详情”按钮,跳转到该商品的详细信息页面
<tr>
<th width="5%">编号</th>
<th width="7%">图片</th>
<th width="15%">商品名称</th>
<th width="10%">商品类别</th>
<th width="10%">状态</th>
<th width="10%">操作</th>
</tr>
<tr th:each="product:${productList}">
<td th:text="${productStat.index+1}"></td>
<td><img th:src="${product.imageurl}" alt="" width="70" height="50" /></td>
<td th:text="${product.pname}"></td>
<td th:if="${product.sort}"></td>
<td th:if="${product.status}"></td>
<a th:href="@{/productdetail(pid=${product.pid})}"><span class="icon-list-alt"></span>详情</a>
<a href="javascript:void(0)" onclick="return del(17)"><span class="icon-trash-o"></span> 删除</a>
</td>
</tr>
关键代码:
<a th:href="@{/productdetail(pid=${product.pid})}"><span class="icon-list-alt"></span>详情</a>