【问题标题】:Meteor / Blaze confusion over naming conventionsMeteor / Blaze 对命名约定的混淆
【发布时间】:2017-02-23 02:26:14
【问题描述】:

刚刚完成 Meteor 教程。我目前在更新/删除部分https://www.meteor.com/tutorials/blaze/update-and-remove

代码显示

<template name="task">
<li class="{{#if checked}}checked{{/if}}">
<button class="delete">&times;</button>

<input type="checkbox" checked="{{checked}}" class="toggle-checked" />

<span class="text">{{text}}</span>
</li>
</template>

我对“已检查”需要相同的地方感到困惑。它只在花括号中吗?

【问题讨论】:

    标签: meteor meteor-blaze


    【解决方案1】:

    花括号调用到模板数据或帮助器的数据绑定

    花括号中的{{checked}} 将替换为当前数据值(在这种情况下为truefalse,具体取决于数据库中项目的状态)。

    由于checked 是一个布尔值,这将根据您的项目中存储的内容呈现为真或假。

    【讨论】:

      猜你喜欢
      • 2013-02-24
      • 2016-10-21
      • 2012-12-19
      • 1970-01-01
      • 1970-01-01
      • 2012-09-06
      • 2015-10-12
      • 1970-01-01
      • 2012-03-29
      相关资源
      最近更新 更多