zoukankan      html  css  js  c++  java
  • Thymeleaf模板布局

    ⒈定义片段

      1.使用th:fragment   

    1     <div th:fragment="copy">
    2         &copy; 2019 <a href="http://www.coreqi.cn">Coreqi</a>
    3     </div>

      2.不使用th:fragment 

    1     <div id="copy-section">
    2         &copy; 2019 <a href="http://www.coreqi.cn">Coreqi</a>
    3     </div>

    ⒉引用片段

      1.引用使用th:fragment的片段

    1     <div th:insert="~{footer :: copy}"></div>

      2.引用不使用th:fragment的片段

    1     <div th:insert="~{footer :: #copy-section}"></div>

    ⒊引用模板使用的th:insert、th:replace、th:include三者之间的区别

    • th:insert  将简单地插入指定的片段作为正文的主标签
    • th:replace      用指定实际片段来替换其主标签
    • th:include        类似于th:insert,但不是插入片段,而是只插入此片段的内容(3.x版本后不再推荐使用)
  • 相关阅读:
    Java 插入排序
    Java 浮点型与双精度数值比较
    Java 包装类Integer的值比较
    ORA-00942 table or view does not exist
    logging模块
    面向对象
    模块和包
    异常处理
    序列化模块
    css3选择器
  • 原文地址:https://www.cnblogs.com/fanqisoft/p/10533282.html
Copyright © 2011-2022 走看看