【发布时间】:2014-03-23 00:01:05
【问题描述】:
我有一个包含 2 个容器 1)productView 和 2)calendarView 的布局。我的路由器配置如下:
this.route('productDetail', {
layout: 'main',
path: '/products/:_id',
waitnOn: function(){...},
data: function(){...},
yieldTemplates: {
'calendarView: { to: calendar }
}
});
我现在希望在路线更改时(例如从“products/1”更改为“products/2”)仅重新渲染 productView 而 calendarView 什么都不做。至于现在,每次调用“productDetail/:id”路由时,都会调用“calendarView”函数“Template.calendarView.rendered”并重新渲染模板。我的“主要”模板如下所示:
<template name="main">
<div>
{{yield}}
</div>
<div>
{{yield 'calendar'}}
</div>
</template>
有没有办法告诉路由器只渲染某些模板?还是有更好的解决方案? 非常感谢任何帮助。
【问题讨论】:
标签: meteor iron-router