标签:span 推荐 replace 官方 需要 jquery footer thymeleaf 区别
关于thymeleaf中th:insert、th:replace、th:include的区别
1 需要替换的片段内容: 2 <footer th:fragment="copy"> 3 <script type="text/javascript" th:src="@{/plugins/jquery/jquery-3.0.2.js}"></script> 4 </footer> 5 6 导入片段: 7 <div th:insert="footer :: copy"></div> 8 9 10 结果为: 11 <div> 12 <footer> 13 <script type="text/javascript" th:src="@{/plugins/jquery/jquery-3.0.2.js}"></script> 14 </footer> 15 </div>
1 需要替换的片段内容: 2 <footer th:fragment="copy"> 3 <script type="text/javascript" th:src="@{/plugins/jquery/jquery-3.0.2.js}"></script> 4 </footer> 5 6 导入片段: 7 <div th:replace="footer :: copy"></div> 8 9 结果为: 10 <footer> 11 <script type="text/javascript" th:src="@{/plugins/jquery/jquery-3.0.2.js}"></script> 12 </footer>
1 需要替换的片段内容: 2 <footer th:fragment="copy"> 3 <script type="text/javascript" th:src="@{/plugins/jquery/jquery-3.0.2.js}"></script> 4 </footer> 5 6 导入片段: 7 <div th:include="footer :: copy"></div> 8 9 结果为: 10 <div> 11 <script type="text/javascript" th:src="@{/plugins/jquery/jquery-3.0.2.js}"></script> 12 </div>
thymeleaf中th:insert、th:replace、th:include的区别
标签:span 推荐 replace 官方 需要 jquery footer thymeleaf 区别
原文地址:https://www.cnblogs.com/lxzlovewyq/p/13298383.html