gpt4 book ai didi

thymeleaf - Thymeleaf 包含和替换之间的区别?

转载 作者:行者123 更新时间:2023-12-02 21:43:02 27 4
gpt4 key购买 nike

两个 Thymeleaf 属性有什么区别:th:includeth:replace

最佳答案

根据documentation如果您遇到这种情况:

<div th:include="..."> content here </div>

片段将被放置在 <div> 内标签。

但是当您使用替换时:

<div th:replace="..."> content here </div>

然后<div>将被内容替换。

Thymeleaf can include parts of other pages as fragments (whereas JSP only includes complete pages) using th:include (will include the contents of the fragment into its host tag) or th:replace (will actually substitute the host tag by the fragment’s).

关于thymeleaf - Thymeleaf 包含和替换之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37103958/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com