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>
themeleaf引入公共页面的更多相关文章
- 微信小程序 引入公共页面的几种情况
1.不带参数 首先在pages文件夹中新建一个template文件夹,文件夹中新建一个template.wxml文件,代码如下 <!--template.wxml--> <templ ...
- Thymeleaf静态资源引入方式及公共页面代码抽取
静态资源引入 Thymeleaf模板引擎url问题,要用如下的方式写,确保在任何情况下都能访问到 <!-- Bootstrap core CSS --> <link href=&qu ...
- Thymeleaf引入公共片段方式
引入公共片段 引入公共片段的th属性,包括三种方式 th:insert 将公共片段,整个插入到声明引入的元素中 th:replace 将声明引入的元素,替换为公共片段 th:include 将被引入的 ...
- 通过动态包含和Ajax机制抽取Web应用的公共页面
在Java Web应用开发中,经常遇到的一种情况是,许多的页面中都包含着“公共页面”,这部分动态页面的特征是:访问量大,会带来较大的性能压力.功能设计上会动态地改变自身的元素.比如在登录前和登录后所展 ...
- 11、SpringBoot-CRUD-thymeleaf公共页面元素抽取
thymeleaf公共页面元素抽取 存在一种现象:两个文件的代码只有一部分代码不一样 其余的均相同,此时就可以提取公共的代码去简化开发 .抽取公共片段 <div th:fragment=&quo ...
- 使用iframe引入公共模块
新建一个公共文件head.html <!DOCTYPE html><html lang="en"><head> <meta charset ...
- ThinkPHP5——引入公共部分head和foot(多种方法)
在项目中,header和footer重复使用的次数高,于是我们把header和footer作为公共部分,其他模板需要的话就引用.下面我教大家引用公共模板 1.使用include 首先在view下面新建 ...
- thymeleaf 模板使用 提取公共页面
切记!!!thymeleaf模板的使用,姿势很重要!!!姿势不对,可能导致样式.js等的使用受到影响 前台开发中,由于页面目录结构不同,可能导致引入的公共页面中的的跳转路径在部分页面能用,部分页面不能 ...
- 如何针对Thymeleaf模板抽取公共页面
对于公共页面(导航栏nav.页头head.页尾footer)的抽取有三种方式: 1)基于iframe进行抽取,这种方式很有效,但比较老了,另外为了页面的自适应性,还得做不少工作: ...
随机推荐
- 1)requests模块
一:requests 介绍 requests 是使用 Apache2 Licensed 许可证的 基于Python开发的HTTP 库,其在Python内置模块的基础上进行了高度的封装, 从而使得Pyt ...
- SQLServer 2014 本地机房HA+灾备机房DR解决方案
SQLServer 2014 主数据中心HA+灾备机房DR解决方案 SQLServer 2008 的时候使用 local WSFC+DR Mirror方式,对象是单数据库 两个单独的 WSFC 上使用 ...
- iOS 运行时使用(交换两个方法)
举例 在创建了如下代码 NSString *str=nil; NSURL *url =[NSURL URLWithString:str]; NSLog(@"%@",url); 但是 ...
- 单击列表行前边的checkbox被选中,再单击,取消选中
需求描述:单击datatabl的一行数据,前边的checkbox被勾选上,再次点击,选中取消,第一次碰到这种需求,不过呢也很实用,简单记录一下 代码: //html代码<tr class=&qu ...
- laravel 服务提供者
服务提供者,在laravel里面,其实就是一个工厂类.它最大的作用就是用来进行服务绑定.当我们需要绑定一个或多个服务的时候,可以自定义一个服务提供者,然后把服务绑定的逻辑都放在该类的实现中.在lara ...
- django----基于Form组件实现的增删改和基于ModelForm实现的增删改
一.ModelForm的介绍 ModelForm a. class Meta: model, # 对应Model的 fields=None, # 字段 exclude=None, # 排除字段 lab ...
- 目标检测算法之Faster R-CNN算法详解
Fast R-CNN存在的问题:选择性搜索,非常耗时. 解决:加入一个提取边缘的神经网络,将候选框的选取交给神经网络. 在Fast R-CNN中引入Region Proposal Network(RP ...
- 金蝶k3密码批量修改
该字段含有单引号,直接使用查询语句,需要转义其中的单引号.select * from t_User where FSID = ') F ", ,P T #8 *P!D &D 80!N ...
- xxl系列部署启动通用办法
http://10.10.6.186:8080/xxl-job-admin # 编译mvn compile # 清理mvn clean # 打包mvn package # 先清理后编译mvn clea ...
- C# 中的readonly属性
例如我们这里有一个类 class TestClass2 { private int someValue; public void ChangeValue(int newValue) { someVal ...