我尝试遵循 ( https://github.com/linkedin/dustjs/wiki/Dust-little-less-know-language-constructs ) 教程中的示例 1。然后我进行如下测试:
部分.tl
{+greeting} Hola {/greeting}
{+world} World {/world}
Main.html
<script type="text/x-template" id="itemTemplate">
{>partial/}
</script>
但是没有成功。如果您知道如何制作部分模板,请告诉我如何做。 Dust.js 教程/指南在互联网上很难找到。
谢谢。
最佳答案
Dust 必须先编译为 JavaScript,然后才能执行。 .tl 和 .dust 文件只是源格式。如果您处于客户端环境中,这里有一个很好的解释。 Basic Example of Client Side Templating with Dust.js
关于javascript - Dust.js 部分模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24323859/