我是流星新手,使用javascript的經驗有限。我已經搜索了所有的帖子和網頁,瞭解如何使用Iron Router軟件包來路由靜態頁面的一個很好的教程,而且似乎無法弄清楚這一點。我希望有人幫助我瞭解如何爲Home and About設置router.js文件。我已經玩了很多代碼,但這是我在發佈之前所做的。在我看來,我似乎很難理解路由如何工作以及鐵路由器的所有各種功能,然後將這些路由連接到導航欄中,以便在它們之間導航。提前感謝您提供的任何幫助。靜態網站使用流星的路由器
客戶端/模板/應用/的layout.html
<template name="layout">
<div class="container">
{{> yield}}
</div>
</template>
的lib/router.js
Router.configure({
layoutTemplate: 'layout'
});
Router.route('/', function() {
this.render('home', {
template: 'home'
});
this.render('about', {
template: 'about'
});
});
模板/ home.html的
<template name="home">
<div class="container">
<h2>Home</h2>
</div>
</template>
http://meteortips.com/tutorial/iron-router-part-1/ – yoK0 2014-11-05 07:38:56