zoukankan      html  css  js  c++  java
  • Thymeleaf 使用指南

    一、常用标签

    th:block 

    不显示

    th:include

    替换内容到引入的文件

    二、关联css与js

    href 和 src : 用于直接预览页面(在不启动服务器的情况下)

    th:href 和 th:src 启动服务器时使用

    <link rel="stylesheet" href="../static/assets/plug-in/antd2.2.2/antd.min.css" th:href="@{~/assets/plug-in/antd2.2.2/antd.min.css}"/>
    <script src="../static/assets/plug-in/vue3.1.5/vue.global.js" th:src="@{assets/plug-in/vue3.1.5/vue.global.js}"></script>
    <script src="../static/assets/plug-in/antd2.2.2/antd.min.js" th:src="@{assets/plug-in/antd2.2.2/antd.min.js}"></script>
    <script src="../static/assets/plug-in/moment/moment.js" th:src="@{assets/assets/plug-in/moment/moment.js}"></script>
    <script src="../static/assets/plug-in/lodash1.8.3/lodash.js" th:src="@{assets/plug-in/lodash1.8.3/lodash.js}"></script>
    <script src="../static/assets/base/common.js" th:src="@{assets/base/common.js}"></script>

     二、公共内容引用

    <!DOCTYPE html>
    <html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head th:fragment=header>
        <meta charset="UTF-8">
        <title>Title</title>
        <link href="../static/assets/plug-in/antd2.2.2/antd.min.css" rel="stylesheet"/>
    </head>
    
    
    <body>
    
    </body>
    <div th:fragment="footer">
    </div>
    </html>
  • 相关阅读:
    项目Alpha冲刺Day7
    项目Alpha冲刺Day5
    项目Alpha冲刺Day6
    Alpha冲刺总结
    测试随笔
    项目Alpha冲刺Day12
    高校征信系统项目Postmortem结果
    冲刺合集
    总结随笔
    测试工作安排
  • 原文地址:https://www.cnblogs.com/ghostnet/p/15102820.html
Copyright © 2011-2022 走看看