Fork me on GitHub

FreeMarker在List中取任意一条数据的某一个值

首先你要知道要取的数据的下标

<#list itemsList as item>
<#if item_index==1>
<#if "${item.value}"=="合格">
<w:t>✔</w:t>
<#else>
<w:t>✖</w:t>
</#if>
</#if>
</#list>

注:_index 就是找对应下标(0、1、...),value就是你要去的对象中的值属性
posted @ 2020-07-02 09:58  涛声-依旧  阅读(3101)  评论(0)    收藏  举报