Handlebars学习(5)- 模板注释{{!--}}或{{!}}
可以再Handlebars代码中使用注释。
<div class="entry">
{{!-- only output this author names if an author exists --}}
{{#if author}}
<h1>{{firstName}} {{lastName}}</h1>
{{/if}}
</div>
注释不会在结果中输出。如果你想要注释输出,可以使用html注释,这样注释就会被输出。
<div class="entry">
{{! This comment will not be in the output }}
<!-- This comment will be in the output -->
</div>
任何注释都必须包含结束标记}},而其它的Handlebars标记应该使用{{!-- --}}语法。

浙公网安备 33010602011771号