[英]Meteor - FlowRouter - Blank pages
大家好,我正在做一個關於擴展用戶類的教程, 鏈接到tutorial1在我嘗試的每條路徑中,我總會得到一個空白頁,並且我不明白為什么。 任何幫助,將不勝感激。 這是我的routes.js文件:
FlowRouter.route('/', {
name: 'home',
action: function() {
BlazeLayout.render("mainLayout", {
content: "home"
});
}
});
FlowRouter.route('/login', {
name: 'login',
action: function() {
BlazeLayout.render("mainLayout", {
content: "login"
});
}
});
FlowRouter.route('/register', {
name: 'register',
action: function() {
BlazeLayout.render("mainLayout", {
content: "register"
});
}
});
這是我的main-layout.html
<template name="mainLayout">
{{>Template.dynamic template=content}}
</template>
這是我的倉庫的鏈接: https : //bitbucket.org/mmrj9/hubapp/src
頁面上的其他一些問題也導致了問題。 flow-router
的使用很好。 它們使用靜態HTML節點可以很好地呈現。
假設您的首頁是精簡版,
<template name="home">
Home Page.
</template>
,按預期方式在客戶端呈現字符串。
此處不會列出問題,但希望它為您提供一些啟發。
您是否定義了其他模板?
例如主頁模板
<template name="home">
{{#with currentUser}}
<div class="ui raised segment">
<h1 class="ui header">Current User</h1>
<p>First Name: {{profile.firstName}}</p>
<p>Last Name: {{profile.lastName}}</p>
<p>Profile Picture: <img class="ui small circular image" src="{{profile.profPicture}}" /></p>
<p>Organization: {{profile.organization}}</p>
</div>
{{/with}}
</template>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.