thymeleaf常用的一些标签属性
来源:互联网 发布:人民币大小写转换软件 编辑:程序博客网 时间:2024/06/07 17:46
用thymeleaf模版,总结了下经常用到的一些属性:
从后台传过来一个List,需要到前端页面显示,所以一般先进行判断——该List是否为空,然后才是加载内容,而有些页面加载的时候需要获取序号,具体代码如下:
<th:block th:if="${not #lists.isEmpty(purchaseDemandList)}"> <li class="list-group-item row entry-default-child entry-default-xs weaker-font-color text-center"> <div><span>序号</span></div> <div><span>名称</span></div> <div><span>周期</span></div> <div><span>数量</span></div> </li> <th:block th:each="purchaseDemand,index:${purchaseDemandList}"> <li class="list-group-item row entry-default-child entry-default-xs weaker-font-color text-center"> <div><span th:text="${index.count}">序号</span></div> <div><span th:text="${purchaseDemand.goodsName}" >商品名称</span></div> <div><span th:if="${purchaseDemand.purchaseCycle=='half_month'?'半个月':'一个月'}">采购周期</span></div> <div><span th:text="${purchaseDemand.num}"> 数量</span></div> </li> </th:block></th:block>
序号对象获取:
<th:block th:each="purchaseDemand,index:${purchaseDemandList}"><span th:text="${index}">序号</span></th:block>
${index}结果如下:
时间格式化
th:text="${#calendars.format(nowTime,'yyyy-MM-dd')}"
转载请标明原址:http://blog.csdn.net/zheng911209/article/details/48181285
0 1
- thymeleaf常用的一些标签属性
- thymeleaf常用的一些标签属性
- dedecms一些常用的标签属性讲解
- thymeleaf 个人常用标签
- Thymeleaf 常用属性
- Thymeleaf 常用属性
- Thymeleaf 常用属性
- Thymeleaf 常用属性
- 一些不常用的html标签及css属性
- 关于DOM的一些常用标签属性等小结
- 常用的属性标签
- Thymeleaf的内置属性
- thymeleaf的属性优先级
- <activity>标签的一些属性
- input标签的一些属性
- Spring标签的常用属性
- Bean标签的常用属性
- struts2的一些常用标签
- 编写一个存储过程 sqlserver专用 oracle稍有区别
- Android文件的下载
- 一些不常见的C++关键字
- UITextView控件的用法详解
- 多线程例子
- thymeleaf常用的一些标签属性
- iOS开发工具——Reveal:iOS的UI设计分析利器
- (二)使用IDLE进行编程
- Android Studio中Gradle使用详解
- UIView详解
- Facebook开源项目:我们为什么要用Fresco框架?
- OGRE源代码编译超详细步骤
- OGRE学习记录-Dot3Bump例子
- Autodesk FBX