Thymeleaf 使用时的标签
1 . onclick事件
<a th:onclick="'javascript:more()'" ></a>
2.引入CSS样式
<link th:href="@{fore/css/public.css}" rel="stylesheet">
3.引入js 文件
<script th:src="@{fore/js/index.js}" type="text/javascript"></script>
4. 引入头部信息,和尾部信息
注:html(文件夹)/public.html 页面上的 头部和尾部信息引入
<!-- 导航 头部信息-->
<!-- 导航 头部信息引入 -->
<div class="nav-container" th:fragment="topper">
<div th:replace="html/public :: topper">
</div>
<!-- 底部信息 -->
<!-- 底部信息引入 -->
<div class="att-bottom" th:fragment="footer">
<div th:replace="html/public :: footer"></div>
5. 图片引入
<img th:src="@{fore/images/nav_icona.png}"/>
6.页面遍历
<li th:each="item,i:${list}"></li>
7.if 判断 以及 th:text 取值
<span th:if="${item.types==1}" style="color:green;">
<span th:text=" ${item.coinNum}" ></span>
<i class='fa fa-database'></i>
</span>
8.时间类型格式化
<span th:text="${#dates.format(item.updateTime,'yyyy/MM/dd HH:mm')}"></span>
9.自定义标签属性
<div th:attr="_tId=${item.taskId}">
10.获取css样式 <i class='fa fa-database'></i>
获取 <i class='fa fa-database'></i> 图标样式 时,
<i>标签不能写在th:text <span>的取值中,
另写一个'<span>'标签 与取值的<span标签不属于同一标签内即可> (如下)
<span th:if="${item.types==1}" style="color:green;">
<span th:text=" ${item.coinNum}" >
</span> <i class='fa fa-database'></i>
</span>
这样即可获取 <i class='fa fa-database'></i> 图标样式
11.themeleaf if标签判断显示哪一个

根据 th:if="${item.authstate != 1}" 值判断显示哪一个
12.themeleaf字符串拼接
th:id="|autohomeId${i.index}|" 字符拼接两个大竖线
类似的 class属性等,有多个需要竖线全部包含 th:class="|per-addId per-addtype${i.index}|" 所使用的属性前要加 th 标识
Thymeleaf 使用时的标签的更多相关文章
- <context:component-scan>子标签:<context:include-filter>和<context:exclude-filter>使用时要注意的地方
在Spring MVC中的配置中一般会遇到这两个标签,作为<context:component-scan>的子标签出现. 但在使用时要注意一下几点: 1.在很多配置中一般都会吧Spring ...
- 【SpringMVC】<context:include-filter>和<context:exclude-filter>使用时要注意的地方
http://jinnianshilongnian.iteye.com/blog/1762632 http://blog.51cto.com/wenshengzhu/1700340 http://ww ...
- Cookie使用时需要注意个数及大小限制
各浏览器对Cookie有一定的限制,在使用时需要格外注意. 各浏览器之间对cookie的不同限制: IE6.0 IE7.0/8.0/9.0+ Opera FF Safari Chrome cook ...
- EntityFrameWork 使用时碰到的小问题
EntityFrameWork 使用时碰到的小问题 1,在使用orm访问数据库的相目里,也要引用EntityFrameWork.dll,否则无法使用orm 否则,编译错误 错误 5 "Sys ...
- MySQL 安装和启动服务,“本地计算机 上的 MySQL 服务启动后停止。某些服务在未由其他服务或程序使用时将自动停止。”
MySQL 安装和启动服务,以及遇到的问题 MySQL版本: mysql-5.7.13-winx64.zip (免安装,解压放到程序文件夹即可,比如 C:\Program Files\mysql-5. ...
- MaterialCalendarView使用时遇到的问题
一.概述 MaterialCalendarView是一个开源项目.功能强大支持多选.单选.标注等. 二.问题 1.其继承自ViewGroup,故与CalendarView半毛钱关系都没有,完全是一个新 ...
- [备忘][转]rsync使用时的常见问题
sync使用时的常见问题: 错误1: rsync: read error: Connection reset by peer (104) rsync error: error in rsync pro ...
- 小白学数据分析----->移动游戏的使用时长分析
写下该文章,是因为之前看到了几款游戏一个典型的玩家刺激活动,在<多塔联盟>,<萌江湖>等多款游戏的设计中都有体现,如下图所示: 这个功能点的设计,今天在这里讲的更多的还是跟数据 ...
- VS2010 使用时选择代码或双击时出错,点击窗口按钮后VS自动重启问题
VS2010 使用时选择代码或双击时出错崩溃,点击窗口按钮后VS自动重启问题 下载补丁,打上补丁之后,重启电脑,解决了问题. WindowsXP的下载地址:Windows XP 更新程序 (KB971 ...
随机推荐
- 三种方法解决android帮助文档打开慢
三种方法解决android帮助文档打开慢 经查是因为本地文档中的网页有如下两段js代码会联网加载信息,将其注释掉后就好了 <link rel="stylesheet" h ...
- HDU1215 七夕节(模拟 数学)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1215 七夕节 Time Limit: 2000/1000 MS (Java/Others) Me ...
- CGAL 4.6 - Surface Reconstruction from Point Sets
http://doc.cgal.org/latest/Surface_reconstruction_points_3/ The following example reads a point set, ...
- video object detection
先说一下,我觉得近两年最好的工作吧.其他的,我就不介绍了,因为我懂得少. 微软的jifeng dai的工作. Deep Feature Flow github: https://github.co ...
- cuda 8.0, ssd
error info and resolution: https://github.com/weiliu89/caffe/issues/38 https://github.com/weiliu89/c ...
- JS中遍历数组、对象的方式
1.标准的for循环遍历数组 //不打印自定义属性和继承属性 var array = [1,2,3]; for (var i = 0; i < array.length; i++) { cons ...
- 选择排序_C语言_数组
选择排序_C语言_数组 #include <stdio.h> void select_sort(int *); int main(int argc, const char * argv[] ...
- ABAP术语-Lock Mode
Lock Mode 原文:http://www.cnblogs.com/qiangsheng/archive/2008/02/29/1085732.html Status that determine ...
- springmvc的类型转换器converter
这个convter类型转换是器做什么用的? 他是做类型转换的,或者数据格式化处理.可以把数据在送到controller之前做处理.变成你想要的格式或者类型.方便我们更好的使用. 比如说你从前台传过来一 ...
- HBase学习(三):数据模型
和传统的关系型数据库类似,HBase以表(Table)的方式组织数据.HBase的表由行(Row)和列(Column)共同构成,与关系型数据库不同的是HBase有一个列族(ColumnFamily)的 ...