<div class="ui attached segment m-padded-large">
<div class="ui labeled button m-margin-small" th:each="type : ${types}">
<a href="#" th:href="@{/types/{id}(id=${type.id})}" class="ui basic button" th:if="${type.id==actvieTypeId} ? 'teal'" th:text="${type.name}">思考与感悟</a>
<div class="ui basic left pointing label" th:if="${type.id==actvieTypeId} ? 'teal'" th:text="${#arrays.length(type.blog)}">24</div>
</div>
</div>
这段代码没有在界面中显示
相关Controller代码
@Autowired
private BlogService blogService;
@GetMapping("/types/{id}")
public String types(@PageableDefault(size=4, sort={"updateTime"}, direction = Sort.Direction.DESC) Pageable pageable,
@PathVariable Long id, Model model){
List<Type> types = typeService.listTypeTop(1000);
if(id == -1){
id = types.get(0).getId();
}
BlogQuery blogQuery = new BlogQuery();
blogQuery.setTypeId(id);
model.addAttribute("types", types);
model.addAttribute("page", blogService.listBlog(pageable, blogQuery));
model.addAttribute("activeTypeId", id);
return "types";
}
在该段加断点,可得到types的值
解除断点后
分类仍不显示
其他的标签能正常显示?
你可以重启电脑。