{{^在车把中意味着什么 [英] What does {{^ mean in handlebars

查看:103
本文介绍了{{^在车把中意味着什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下内容的句柄模板:

  {{^ is mymodel.someproperty}} 

code>

我不明白插入符号的意义是什么。我已经搜索过,唯一看到的地方是把手表达式



它的用法如下:

{{#each nav}}< a href ={}

< {URL}}> {{#if test}} {{title}} {{^}}清空{{/ if}}< / a> {{〜/ each}}



{{^在句柄中的含义是什么?它看起来像一个.NOT。要不然。或类似的东西。



-Eric

解决方案

而不是在把手文档是因为它是一个叫做倒置部分的胡须构造。



请参阅: https: //mustache.github.io/mustache.5.html#Inverted-Sections

  {{#repo} } 
< b> {{名称}}< / b>
{{/ repo}}
{{^ repo}}
无回购:(
{{/ repo}}


I have a handlebars template that contains:

{{^is mymodel.someproperty}}

I don't understand what the significance of the caret symbol is. I've searched around, the only place I'm seeing it is on Handlebars Expressions

It's used like so:

{{#each nav}}
  <a href="{{url}}">
    {{#if test}}
      {{title}}
    {{^}}
      Empty
    {{/if}}
  </a>
{{~/each}}

What does "{{^" mean in handlebars? It sort of looks like a .NOT. or .ELSE. or something like that.

-Eric

解决方案

The reason it's not in the handlebars doc is because it's a mustache construct called an Inverted Section.

See: https://mustache.github.io/mustache.5.html#Inverted-Sections

{{#repo}}
  <b>{{name}}</b>
{{/repo}}
{{^repo}}
  No repos :(
{{/repo}}

这篇关于{{^在车把中意味着什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆