【发布时间】:2015-03-25 15:20:35
【问题描述】:
我正在学习如何在 Windows 中使用 Meteor(刚刚安装了上周发布的预览版)。我正在使用 WebStorm
我浏览了本教程第 1 页上的说明 (https://www.meteor.com/try),可以在 http://localhost:3000 看到完整呈现的网站。但是,当我按照说明直接从第 2 页 (https://www.meteor.com/try/2) 粘贴代码时,网站无法正常加载。代码是:
<!-- 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>
// 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" }
]
});
}
说明说我应该看到:
待办事项列表 这是任务 1 这是任务2 这是任务 3
相反,我看到了:
待办事项列表 {{#each 任务}} {{> 任务}} {{/each}}
不知何故无法识别 Meteor 代码。我错过了一步吗?我认为这可能与 Windows 版本有关,但第一个案例加载正常。
谢谢。
布伦丹
【问题讨论】:
-
在这里显示我的经验不足,没有意识到我需要从命令行单独加载 Meteor。有没有办法从 WebStorm 中完成这一步?还是每次运行代码时都需要打开命令提示符?
-
谢谢伊桑。早些时候尝试过,但我一直在试图找出 Nitrous。甚至无法让预览工作。
-
你找到解决这个问题的方法了吗?
标签: meteor