gpt4 book ai didi

javascript - meteor : get the opposite statement from a variable into handlebars

转载 作者:行者123 更新时间:2023-12-02 14:24:03 24 4
gpt4 key购买 nike

我正在发现 Meteor,并向自己提出了一件事。在模板中,我们如何将 bool 值从模板反转到 Handlebars 中?

有一个我正在尝试做的事情的例子:

task.html

<li class="{{#if !checked}}checked{{/if}}">
...

但是我收到错误“预期关闭“}}”。也许这是不可能的。

谢谢!

最佳答案

这是您的解决方案:How to IF NOT inside of {{ #each }} template

使用{{#unless}}:

使用示例:

{{#unless checked}}
....
{{/unless}}

关于javascript - meteor : get the opposite statement from a variable into handlebars,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38434065/

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