HTL list循环遍历Map<String, List>
转载自:Sightly : How to Iterate through Map<String , Map>
代码
<div data-sly-use.header="com.xxx.core.models.HeaderModel"
data-sly-list.child="${header.showMap}">
<div class="${child}" style="display:none;"
data-sly-list.pages="${header.showMap[child]}">
<li><a href="${pages.link}.html">${pages.label}</a></li>
</div>
</div>
- 将map以showMap提供
- child显示了map的key
- pages=header.showMap[child] 等于取出了map value的List里的对象,再取出对象中的link和label值
知识离开了脑子,就只是一堆文字

浙公网安备 33010602011771号