I have a Handlebars helper that takes a number and returns a class name. I want to run the helper only if foobar
exists because it might not exist. My initial attempt was:
{{#each content}}
<div class="other_class {{#if foobar}}{{my_helper foobar}}{{/if}}"></div>
{{/each}}
这是因为甲型异构体插入文字标签持有人,而if
帮助人。 我的第二个尝试是:
{{#each content}}
<div class="other_class {{my_helper foobar}}"></div>
{{/each}}
这是因为,如果不存在禁忌,便通过《<条码>>“foobar”,将“条码”改为“条码”。
我知道,如果做的话,{{>untre foo/code>,就会使价值失去约束力,从而没有文字标签持有人。 是否有办法以无约束的方式使用<代码>。