我可以爲Handlebars`模板佔位符指定默認值嗎?Handlebars`模板佔位符的默認值
<script type="x-handlebars-template" id="menu-edit-form-tpl">
<form method="{{method}}" action="{{action}}" class="menu-edit-form">
...
</form>
</script>
我可以指定{{method}}和{{action}}的默認值並在傳遞給編譯模板的對象中跳過它們嗎?
對我來說,只有在寫'{{#if}}'而不是'{{if }(我正在使用metalsmit 1H) – hgoebl 2016-10-20 06:33:14
另一種選擇是使用或餘燼真理助手,給人的語法: {{或方法「POST」}} 從使用餘燼真相助手: https://github.com/jmurphyau/燼真理,助手 – 2017-07-20 03:42:15