thymeleaf-post/patch方法

svmlkihl  于 2021-06-27  发布在  Java
关注(0)|答案(1)|浏览(318)

我正在尝试对复选框(thymeleaf)进行修补/发布方法。
我认为我必须使用javascript,但我不知道如何使用(使用th:each来显示所有任务)。

<dl th:each="task, taskStat : ${tasks}" class="Bd P(10px)">
    <label>
        <input type="checkbox" onclick="return myFunction()" th:value="${task.id}" th:checked="${task.isDone()}"
               th:text="${task.getDescription} + ' |'"/>
        <small th:text="${task.getDeadline()}"></small>
        <small th:if="${task.getDeadline()} == null">(no deadline)</small>
        <button class="button" style="float: right">Edit</button>
    </label>
</dl>
dsf9zpds

dsf9zpds1#

你可以这样用

th:onclick="attentionAuthor([[${contentIndexDto.content.userId}]])"

使用胸腺素 [[ ]] 去实现它

相关问题