html页面怎么使用th:each

html页面怎么使用th:each,第1张

<li th:each="brand: ${brandList}">

<div >

<a th:text="*{brandName}"></a>

</div>

</li>

可以用each,也可以用for循环,举例:function load(userList){var htmlv=""$.each(userList,function(i,item){htmlv+"<tr><td>item.x1</td><td>item.x2</td></tr>"})$("#tableId").find("tbody").prepend(htmlv)}用forfor(...){$(..).append(...)}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/8367750.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-15
下一篇 2023-04-15

发表评论

登录后才能评论

评论列表(0条)

保存