首页 > 其他 > 详细

Thymeleaf碎片使用

时间:2020-06-08 14:47:34      阅读:110      评论:0      收藏:0      [点我收藏+]

碎片原理:

技术分享图片

 

head.html页面要进行碎片化处理(th:fragment="fragment1"   fragment1为index.html页面引用)

<div th:fragment="fragment1">
<span style="background: aqua"> this is header!</span>
</div>

index.html( th:include="head::fragment1"中的head为head.html的前缀,必须保持一致。)

<div id="header" th:include="head::fragment1"></div>

Thymeleaf碎片使用

原文:https://www.cnblogs.com/Fisherman13/p/13065539.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!