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>
  • 相关阅读:
    HtmlParser 2.0 中文乱码问题
    关于phpmyadmin中添加外键的做法
    jquery easyui Tab 引入页面的问题
    Python用户交互input()和print()
    Python运算符
    计算机硬件基础知识(五)操作系统发展史
    Python学习0304作业
    Python的垃圾回收机制
    Python的两种运行程序的方式
    Python发展史和编程语言的分类
  • 原文地址:https://www.cnblogs.com/SimonHu1993/p/9243170.html
Copyright © 2011-2022 走看看