thymeleafDemo

<p th:text="${#strings.concat(accountFinishInfoVo.firstDepartmentName+' - '+accountFinishInfoVo.departmentName)}">
儿科 - 小儿骨科
</p>
strings.concat函数:字符串拼接
<img th:src="${#strings.isEmpty(accountFinishInfoVo.profilePicLarge)} ? 'http://fimg.xx.com/images/xx/xx-user-default.png' : ${accountFinishInfoVo.profilePicLarge}"
width="60" height="60" alt="" title=""/>
strings.isEmpty:字符串判空
 
<a th:href="@{'/user/diagnose/manuscript/go'(mid=${userVo.mid},userId=${userVo.id})}" >个人信息</a>跳转
 
<div th:each="data:${pager.data}" th:remove="tag">
迭代
<div th:switch="${data.itemType}" th:remove="tag">
<div th:case="1" th:remove="tag">
<div th:substituteby="/daily/bp_common::bp_common(${data})"></div>
</div>
<div th:case="2" th:remove="tag">
<div th:substituteby="/daily/me_common::me_common(${data})"></div>
</div>
</div>
th:switch判断
<div th:substituteby="/daily/me_common::me_common(${data})"></div>
th:substituteby="/daily/me_common::me_common(${data})"
组件引用 对应下面代码的
th:fragment="me_common(data)"
<html th:remove="tag" xmlns:th="http://www.thymeleaf.org">
  <div th:fragment="me_common(data)" th:remove="tag">
  </div>
</html>
<p class="sub-title" th:if="${task==null and userVo.staffId==staffInfo.id  or userVo.continueWrite==true}">添加方式:
    <small th:text="${data.addWayStr}">手动添加</small>
</p>
if标签 (and与 or或),条件不成立,不显示P标签





posted @ 2016-10-26 14:25  jagyao  阅读(184)  评论(1编辑  收藏  举报