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>
  • 相关阅读:
    linux 文件系统管理三部曲之二:创建文件系统
    linux 文件系统管理三部曲之一:磁盘分区
    Django 链接MySQL及数据操作
    redis事务
    redis配置文件详解
    redis中hash数据类型
    redis的基础知识
    redis两种持久化方式RDB和AOF
    git命令
    .gitignore中添加的某个忽略文件并不生效
  • 原文地址:https://www.cnblogs.com/SimonHu1993/p/9243170.html
Copyright © 2011-2022 走看看