首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Meteor子模板可以访问父模板助手吗?

Meteor子模板可以访问父模板助手吗?
EN

Stack Overflow用户
提问于 2013-02-28 11:50:13
回答 1查看 5K关注 0票数 16

假设我们有一个父模板和一个子模板:

<template name="parent">
  {{> child }}
</template>

<template name="child">
  {{#if show}}
    //Do something
  {{/if}}
</template>

如果我们将'show‘赋值给父模板:

if (Meteor.isClient){
   Template.parent.show = function(){
     return Session.get('isShowing');
   }
}

有没有办法让子模板访问它?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15127121

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档