【问题标题】:In Meteor how can I tell if my template is being used as a block helper?在 Meteor 中,我如何判断我的模板是否被用作块助手?
【发布时间】:2014-07-31 12:46:19
【问题描述】:

我正在尝试编写一个有时用作块助手的模板,如下所示:

<template name="helpText">
  {{#if isBlockHelper}}
    {{> UI.contentBlock}} 
  {{else}}
    Looks like there's nothing to display!
  {{/if}}
</template>

在meteor中有什么办法吗?

【问题讨论】:

    标签: meteor meteor-blaze


    【解决方案1】:

    事实证明这很简单:

    <template name="helpText">
      {{#if UI.contentBlock}}
        {{> UI.contentBlock}} 
      {{else}}
        Looks like there's nothing to display!
      {{/if}}
    </template>
    

    【讨论】:

      猜你喜欢
      • 2011-11-17
      • 1970-01-01
      • 2011-08-27
      • 2016-10-01
      • 2014-12-20
      • 2015-01-26
      • 1970-01-01
      • 2015-01-06
      • 1970-01-01
      相关资源
      最近更新 更多