如何如果不在{{#each}}模板中 [英] How to IF NOT inside of {{ #each }} template

查看:56
本文介绍了如何如果不在{{#each}}模板中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何渲染此流星火焰模板?我想使用IF的底片,但在任何地方都找不到如何使用它的地方.

How can I render this Meteor Blaze Template ? I would like to use the negative of the IF, but I don't find anywhere how to use it.

<ul>
{{#each pages}}
  {{#if (--NOT--) isCover }}
    <li> some content {{value}} </li>
  {{/if}}
{{/each}}
</ul>

以前的研究未找到解决方案 https://github.com/meteor/meteor/wiki/Using-Blaze 检查空格键是否相等?

Previous research not found solution https://github.com/meteor/meteor/wiki/Using-Blaze Check for equality in Spacebars?

注意:如果我仅使用if语句就可以正常工作,我也可以这样做,而且else也可以,但是我想仅在if(!isCover)解决方案中使用它

Note: if I use only the if statement is working without problem, also I could do and else but I would like to have it only with the if(!isCover) solution

推荐答案

您需要使用{{#unless}}块帮助程序.

You need to use the {{#unless}} block helper.

http://blazejs.org/

{{#unless isCover}}
  <li> some content {{value}} </li>
{{/unless}}

这篇关于如何如果不在{{#each}}模板中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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