【发布时间】:2014-04-30 09:46:37
【问题描述】:
我正在使用 IR 的新 blaze-integration 分支,并对现有应用程序进行了必要的更改。我的一个模板中有一个产量区域:
<div>
{{> yield region='signup-detail'}}
</div>
我想使用yieldTemplates 在路由配置中设置此区域。我的路线是这样配置的:
this.route('signUpInfo', {
path: '/sign-up',
template: 'signUp-form',
yieldTemplates: _.extend({}, mainYieldTemplates, {
'information': {to: 'signup-detail'}
})
});
mainYieldTemplates = {
'footer': { to: 'footer' },
'header': {to: 'header'}
};
我的模板“信息”没有呈现到signup-detail。只有新的鲨鱼分支和 IR blaze 才会发生,Yield 模板有什么变化吗?
页脚和页眉模板设置正确。
编辑:模板布局
<template name="basicLayout">
{{> yield region='header'}}
<div class="container">
<div class="row">
<div class="col-md-12 col-centered padding-top-four-em">
{{> yield}}
</div>
</div>
<hr>
<footer>
{{> yield region='footer'}}
</footer>
</div>
</template>
编辑 2:注册表单模板
<template name="signUp-form">
<div class="col-md-12 signup-container">
{{>signUpSideBar}}
<div class="col-md-9 signup-content gray-border-box">
{{> yield region='signup-detail'}}
</div>
</div>
</template>
注意:注册表单模板有一个区域signup-detail。这是我的路线signUpInfo 需要将information 模板渲染到该区域的地方。这曾经在 blaze-integration 之前在 IR 中工作。
【问题讨论】:
-
你搞定了吗?我在产量区域方面遇到了麻烦,但复制了你所做的,它对我有用。
-
@bgmaster,我仍然没有这个工作。我现在使用
action来渲染我的区域,而不是yieldTemplates选项。我正在尝试隔离问题并查看问题出在哪里 -
你能发布你的整个 layoutTemplate 吗?
-
@bgmaster 我添加了用于 95% 路线的布局模板。
-
似乎对我有用
标签: javascript meteor iron-router