流星流动路由器动态模板

问题描述:

我一直在我的流星应用上工作。现在,如果我在主页上的maincontent是动态的,那将会很棒。我得到这个代码:流星流动路由器动态模板

main.html中

<head> 
    <title>Taskmanager</title> 
</head> 
<body> 
{{> navBar}} 
{{> mainlayout}} 
</body> 

mainlayout.html

<template name="mainlayout"> 
<main> 
{{> Template.dynamic template=main}} 
</main> 
</template> 

routes.js

FlowRouter.route('/', { 
name: 'home', 
action: function() { 
BlazeLayout.render('mainlayout', {main: 'noteOverview'}); 
} 
}); 

noteoverview.html

<template name="noteOverview"> 
<div class="container"> 
    <h3>Latest Tasks</h3> 
</div> 
</template> 

当我打开网页时,mainlayout不加载在noteoverview.html。我是否错过了什么? Thanx任何帮助!

解决: 我忘了补充包:kadira:闪耀布局....愚蠢的错误

+0

我建议上传你的整个项目到GitHub - 它看起来好像处于早期阶段 –

+0

我修好了,愚蠢的从我身边。我忘了添加软件包:kadira:blaze-layout。 Thanx寻求帮助 – Yakalent

您是否尝试过打开这个网址“http://localhost:3000/”?出现什么?

+0

是的,但mainlayout是空的 – Yakalent

我看到你的模板上有一个导航栏。

也许<h3>Latest Tasks</h3>在您的notesOverview模板隐藏在导航栏后面。

尝试增加

body{ margin-top:80px; }

到应用的样式。