gpt4 book ai didi

backbone.js - Handlebars 模板 - if 语句中的 "tilde"

转载 作者:行者123 更新时间:2023-12-03 12:10:42 27 4
gpt4 key购买 nike

我们有这样的声明:

{{~#if someCondition ~}} 
<div class="whyweneedtildehere"></div>
{{~/if~}}

简单 if有什么区别声明和 if Handlebars 模板中带有“~”的语句?

最佳答案

它被称为波浪号,可能会帮助您进一步搜索它。
Handlebars 文档 answers your question in detail .

Template whitespace may be omitted from either side of any mustachestatement by adding a ~ character by the braces. When applied allwhitespace on that side will be removed up to the first handlebarsexpression or non-whitespace character on that side.

关于backbone.js - Handlebars 模板 - if 语句中的 "tilde",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26055401/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com