<%=testEjs %> <% function tree(arr) { %> adadfasdf <% return ""; } %> <%=tree() %> <%=tree() %> <%=tree() %>
<% function __makeTree(obj) { %>
    1. file1
      1. file1
<% } %> <% function outputLeaf(obj) { %>
  • file1
  • <% } %> <% function outputBrunch(list) { %>
  • <% makeTree(list.files) %>
  • <% } %> <% function makeTree(dataList) { %>
      <% for(var i=0; i < dataList.length; i++) { var obj = dataList[i]; if(obj.leaf) { outputLeaf(obj); } else { outputBrunch(obj); } } %>
    <% } %> <% makeTree(data) %>