天天看点

thymeleaf常见用法

1.th:href传参

 th:href="@{/buy/toRenew(userPhone=${userPhone},userAccountName=${userAccountName})}" target="_blank" rel="external nofollow"

2.js function 函数参数

th:οnclick="'javascript:preview(\''+${evidenceManageEnt.pri.sPreserveApplyNum}+'\', \'1\')'"

th:οnclick="'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();

继续阅读