Thymeleaf select回显并选中多个

版权声明:柠檬乐园:200145783 https://blog.csdn.net/u014431237/article/details/82881759

哇.各种搜索,国内几乎找不到thymeleaf回显多个的。都是用什么 th:field ,试了根本没用啊。(而且我去官网没有看到这个filed的介绍,如果有详细说明的请滴滴我)


通过国外的论坛,发现了解决方式超级简单:

rolelist用来回显列表,roleIdlist用来回显选中多个数据。

th:selected="${roleIdList.contains(role.id)}"

猜你喜欢

转载自blog.csdn.net/u014431237/article/details/82881759