【发布时间】:2019-06-10 22:51:44
【问题描述】:
我一直使用thymeleafth:onclick属性调用javascript函数,参数如下
th:onclick="|myFunction('${parameter1}')|"
但是thymeleaf 3.1.10 this has been removed。他们建议使用th:data 属性。
然而,我找到了以下解决方法,并且它们都运行良好。
th:attr="onclick=|myFunction('${parameter1}')|"th:onclick="@{myFunction('${parameter1}')}">
现在我不确定这些变通办法是否是正确的做事方式,如果是,哪个更好。
【问题讨论】:
标签: spring-boot thymeleaf