zoukankan      html  css  js  c++  java
  • themeleaf引入公共页面

    <div th:include="/top :: html"></div>
    //引用公共页面
    <div th:replace="head"></div>
    //引用公共js
    <!DOCTYPE html>
    <html xmlns:th="http://www.thymeleaf.org"
          xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
          th:with='basePath=${#httpServletRequest.getScheme()+"://"+#httpServletRequest.getServerName()+":"+#httpServletRequest.getServerPort()+#httpServletRequest.getContextPath()+"/"}'>
    <head th:fragment="head">
        <base th:href="${basePath}"/>
        <meta value="UTF-8"/>
        <script th:src="@{/js/jquery-3.1.1.min.js}"></script>
        <script th:src="@{/js/moment.js}"></script>
        <script th:src="@{/js/vue.min.js}"></script>
        <script th:src="@{/js/vdt.js}"></script>
        <script th:src="@{/js/vue-router.min.js}"></script>
        <script th:src="@{/js/vue-resource.min.js}"></script>
        <script th:src="@{/js/axios.min.js}"></script>
        <script th:src="@{/js/tool.js}"></script>
        <script th:src="@{/element-ui/lib/index.js}"></script>
        <script th:src="@{/js/vee-validate/vee-validate.min.js}"></script>
        <script th:src="@{/js/vee-validate/vee-zh_CN.js}"></script>
        <script th:src="@{/js/fingerprint2.min.js}"></script>
        <link rel="stylesheet" th:href="@{/element-ui/lib/theme-chalk/index.css}" />
        <link rel="stylesheet" th:href="@{/css/main.css}" />
        <link rel="stylesheet" th:href="@{/css/reset.css}" />
        <script th:inline="javascript">
            var basepPath = [[${basePath}]];
        </script>
    </head>
    </html>
  • 相关阅读:
    listview 优化
    重要博客网址
    bottombar——Fragment
    视频播放,,今日头条样式
    databinding
    Picasso
    22222222
    202004leetcode刷题记录
    批量下载邮箱中指定日期范围的附件
    有雾环境下的目标检测
  • 原文地址:https://www.cnblogs.com/SimonHu1993/p/9243170.html
Copyright © 2011-2022 走看看