1.th:href传参
th:href="@{/buy/toRenew(userPhone=${userPhone},userAccountName=${userAccountName})}"
2.js function 函数参数
th:onclick="'javascript:preview(\''+${evidenceManageEnt.pri.sPreserveApplyNum}+'\', \'1\')'"
th:onclick="'toUpdate(\''+${agent.agentId}+'\',\''+${agent.accountId}+'\')'"
3.span取值两种方式
<span>[[${saveName}]]接串</span>
<span th:text="${saveName+'接串'}"></span>
4.判断class样式
<tr th:class="${row.even}? 'even' : 'odd'">
5.关闭当前弹框,并刷新父页面
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
window.parent.location.reload();
Thymeleaf用法实例
本文介绍Thymeleaf中常见的用法,包括th:href传参、js function函数参数设置、span取值的不同方式、条件渲染class样式及页面操作技巧。
2151

被折叠的 条评论
为什么被折叠?



