freemarker宏的递归调用

<#macro show catalogs>
<#if catalogs?has_content>
<#list catalogs as catalog>
d.add("${catalog.id}",
"${catalog.parentId?default('_TOP')}"
,"${catalog.name}","javascript:changeCatalogId('${catalog.id}');");
<#if catalog.child?exists>
<@show catalogs=catalog.child/>
</#if>
</#list>
</#if>
</#macro>

 

你可能感兴趣的:(JavaScript,freemarker)