如何为流星站点添加菜单/子主题

How to add menus/ subtopics for meteor site?

本文关键字:菜单 添加 流星 站点      更新时间:2023-09-26

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

在<<p> strong> simple-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>
在<<p> strong> simple-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" }
    ]
  });
}

你可以使用IronRouter (Guide)或FlowRouter包来实现。

是的,您可以使用meteor-useraccounts包实现此功能。下面是这个包的实例。

您可以通过完整的文档来理解。