布局模板不会屈服

Layout template will not yield

这让我整个上午都快抓狂了。 (请原谅,我是 meteor 的新手。)我有一个相当简单的设置,遵循 Discover Meteor 中描述的习惯。

首先,lib/router.js:

Router.configure({
   layoutTemplate: 'layout',
   loadingTemplate: 'loading',
   notFoundTemplate: 'notFound'
});

Router.route('/', {name: 'home'});

Router.route('profile', {name: 'UserProfile'});

其次,layout.html:

<template name="layout">
<div class="container">
    {{> navbar}}
    <div id="main">
        {{> yield}}
    </div>
</div>
</template>

最后,client/templates/users/user_profile.html:

<template name="UserProfile">
    <p>hello world</p>
</template>

如果我将 {{> userProfile}} 放在布局中,它可以正常呈现。但是路由器不会为我做这件事,这是它应该做的。

我错过了什么?

我也遇到了这个问题...你没有 post 你的控制台输出,但这是我的解决方案(我回答了我自己的问题):

简而言之,这为我解决了这个问题:meteor add ejson