如何在freemark頁面中獲取到當前list迴圈的counter

直接上程式碼

<#list lists as x>
<#assign j=x?counter>
${j}
//依次輸出1,2,3....根據迴圈次數而定
</#list>

你也看到了,就是x?counter