简体   繁体   English

流星铁:路由器加载空白页

[英]Meteor Iron:Router Loading Blank Page

Before I get to the main problem, I anticipate someone is going to ask what version of iron:router are you running. 在解决主要问题之前,我希望有人会问您正在运行的是哪个版本的iron:router。

I believe I am currently on the latest version of Meteor because when I enter iron update iron:router it displays, "Your packages are at their latest compatible versions.". 我相信我当前正在使用最新版本的Meteor,因为当我输入iron update iron:router时,它会显示“您的软件包为最新的兼容版本”。

However when I enter iron show iron:router it displays 1.0.8 June 1st, 2015 1.0.9 June 2nd, 2015 installed 1.0.10 October 6th, 2015 1.0.11 October 9th, 2015 1.0.12 October 9th, 2015 但是,当我输入Iron show iron:router时,它显示1.0.8 2015年6月1日1.0.9安装于2015年6月2日1.0.10 2015年10月6日1.0.11 2015年10月9日1.0.12 2015年10月9日

as if version 1.0.9 is installed...so not sure how to remedy this situation or how this affects the main problem. 就像安装了1.0.9版本一样...因此不确定如何纠正这种情况或如何影响主要问题。

The main problem is that when I go to go my default localhost:3000/ it displays a blank white page...It should be rendering my 'Home' template and my code is displayed below. 主要的问题是,当我转到默认的localhost:3000 /时,它会显示一个空白的白页...它应该呈现“ Home”模板,并且我的代码显示在下面。 If anyone has any insight into why a blank page is being rendered and can lend some assistance that would be great. 如果有人对为什么要呈现空白页有任何见解,并可以提供一些帮助,那将是很好的。

Here is my code: 这是我的代码:

Router.route('/', function () {
this.render('Home');
});

Router.configure({
layoutTemplate: 'Home',
loadingTemplate: 'Loading',
notFoundTemplate: 'NotFound'
});

You're trying to render Home into Home . 您正在尝试将Home渲染为Home When you have a layoutTemplate it normally contains a {{> yield}} which then gets replaced with whatever template you are actually rendering. 当您有一个layoutTemplate它通常包含一个{{> yield}} ,然后将其替换为您实际渲染的任何模板。 Try: 尝试:

html: 的HTML:

<template name="layout">
... whatever you need on every layout, ex: header
{{> yield }}
... things like your footer
</template>

js: js:

Router.configure({
  layoutTemplate: 'layout',
  loadingTemplate: 'Loading',
  notFoundTemplate: 'NotFound'
}); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM