thymeleaf中 th的几种拼接方法

论坛 期权论坛 脚本     
匿名技术用户   2021-1-15 06:50   829   0

1、拼接href \src

src示例:

<img th:src="@{/img/research/{filename}(filename=${research.filename})}">

href示例:

<a th:href="@{'https://'+${url.url}}" th:text="${url.urlName}"></a>

2、拼接onclick

方式1、

<button class="btn" th:οnclick="'audit(' + ${items.id} + ');'">通过审核</button>

方式2、

<button th:οnclick="|audit(${items.id} )|">通过审核</button>

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP