0
我有这样的HomeLayout.html:流星Iron.Router动态模板
<template name="HomeLayout">
<main>
{{>Template.dynamic template=main}}
</main>
</template>
而一个LoginLayout.html这样的:
<template name="LoginLayout">
<main>
<p> Login Layout Test </p>
</main>
</template>
我想里面输入HomeLayout这LoginLayout 。 要启动HomeLayout我用这个代码:
Router.route('/', function() {
this.render('HomeLayout');
});
但我不知道我怎么可以加载内部HomeLayout这LoginLayout ...
不能使用{{> yield}}工作,并使用当前路由名称查找匹配的模板? –
@JanJoukeTjalsma是的,但动态模板通常不受i-r控制,它们由提供传递给动态模板的变量控制。动态模板提供了对'{{> yield}}'的额外控制,例如,当您想要跨模板共享事件映射时,它非常有用。 –