2015-06-09 30 views
0

我是流星的新手。我遵循教程并成功制作了如下所示的简单界面。我试图找到示例来添加像this这样的菜单/子主题,点击时不会重新加载页面,但我找不到任何示例。你能给我举个例子怎么做?如何为流星网站添加菜单/子主题?

简单todos.html

<head> 
    <title>Todo List</title> 
</head> 
<body> 
    <div class="container"> 
    <header> 
     <h1>Todo List</h1> 
    </header> 
    <ul> 
     {{#each tasks}} 
     {{> task}} 
     {{/each}} 
    </ul> 
    </div> 
</body> 

<template name="task"> 
    <li>{{text}}</li> 
</template> 

简单todos.js

if (Meteor.isClient) { 
    // This code only runs on the client 
    Template.body.helpers({ 
    tasks: [ 
     { text: "This is task 1" }, 
     { text: "This is task 2" }, 
     { text: "This is task 3" } 
    ] 
    }); 
} 

回答