<#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>
本文介绍了一种使用宏定义来展示目录结构的方法。通过递归的方式加载并显示各个子目录,每个目录都具备唯一ID,并能通过调用特定的JavaScript函数实现目录的选择。此方法适用于需要动态展示文件或目录树的应用场景。
561

被折叠的 条评论
为什么被折叠?



