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>
  • 相关阅读:
    Windows下编译TensorFlow1.3 C++ library及创建一个简单的TensorFlow C++程序
    flask自动重启与配置文件导入,路由重定向(8)
    go(4)字符串的应用
    go(3)变量的应用与数据类型
    go(2)输出,转义,字符接收
    go(1)
    tornado集成wtforms
    HTML5笔记007
    HTML5笔记006
    HTML5笔记005
  • 原文地址:https://www.cnblogs.com/ghostnet/p/15102820.html
Copyright © 2011-2022 走看看