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值
posted @ 2021-01-22 13:43  lwxx  阅读(209)  评论(0)    收藏  举报