随笔分类 - Thymeleaf
Thymeleaf
摘要:Thymeleaf判断集合是否为空最近项目使用的是thymeleaf。项目架构是Springboot+Thymeleaf。 在判断集合是否为空的时候踩了坑与大家分享。 以下代码是判断集合是否为空的,myCart是集合。 <div th:if="${#lists.isEmpty(myCart)}" >
阅读全文
摘要:使用方法:注意:传递参数时如果参数是数字这样写没有问题,但是如果参数是字符串onclick的方法将无法接收到参数并报错,所以参数是字符串时要加单引号。如上图。
阅读全文
摘要:使用场景:用户角色一对多关联关系 <!-- roleList:所有角色信息 ;userRoleList:用户已有角色id列表--> <input th:each="role:${roleList}" type="checkbox" th:value="${role.id}" th:checked="
阅读全文
摘要:<th:block th:each="image : ${#strings.listSplit(goods.images, ';')}"> <img th:src="${image}" style="max-height: 150px;"></th:block>
阅读全文
摘要:Thymeleaf 在页面中直接显示内容 一般情况下 Thymeleaf 模板要输出变量需要在某个标签中(如<div>、<span>)写th:text等属性来实现。但有时我们希望想不写在标签中,直接输出变量的值,比如在 <title> 标签中直接显示变量 msg 的值,而不需要包含在 <span>
阅读全文
摘要:thymeleaf的手动渲染HTML模板 长河 2018-11-14 11:18:10 6833 收藏 2 分类专栏: Springboot 版权 现在很多公司都在thymeleaf作为前端的显示,但是刚看了一份博客,现在还有人在不断的诟病thymeleaf的性能问题,然后听说了一个超级牛逼的叫be
阅读全文
摘要:<label th:each="role:${roles}" class="check-box"> <input th:each="item:${sysAdmin.roles}" th:checked="${item.roleId == role.roleId}" name="role" type=
阅读全文
摘要:后台代码 List<ExamTestPaperDO> list = examTestPaperService.list(map); model.addAttribute("testPaper",list); model.addAttribute("testPaperId",request.getPa
阅读全文