【发布时间】:2019-09-09 13:09:13
【问题描述】:
我已多次阅读有关模板的 Mustache 规范,但我无法弄清楚如何忽略车把表达式。我有一个必须渲染 {{value}} 的小胡子模板,如图所示,但小胡子似乎没有办法逃脱把手。
http://mustache.github.io/mustache.5.html
例如;
example.mustache
<p>This would {{value}} not be changed</p>
我需要将上面的{{value}} 打印在模板输出中。
这是一个演示我尝试过的代码片段。
console.log(Mustache.render('Example of {{value}} what I want ignored',{}));
console.log(Mustache.render('Does not work \\{\\{value\\}\\}',{}));
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/3.0.3/mustache.js"></script>
我确定这很简单,但我想不通。
【问题讨论】:
标签: javascript templates mustache