Juicer模板代码:
<script id="tpl" type="text/template">
<ul>
{@each list as it,index}
<li>${it.name} (index: ${index})</li>
{@/each}
{@each blah as it}
<li>
num: ${it.num} <br />
{@if it.num==3}
{@each it.inner as it2}
${it2.time} <br />
{@/each}
{@/if}
</li>
{@/each}
</ul>
</script>
以前用 jQuery Templates
的时候,模板内很容易写JavaScript代码,用Juicer改怎么办?
例如:在模板内应用JSON.stringify();
月关宝盒
相关分类