我正在做这个 Meteor 课程,其中使用了旧版本的 Meteor,并且不确定将文件和文件夹放在哪里。我在我的主文件夹和以下 main.html 客户端代码中的公共文件夹中有图像
<head>
<title>image_share</title>
</head>
<body>
<h1>Welcome to Coursera!</h1>
{{>images}}
</body>
<template name="images">
{{#each images}}
<img src="{{img_src}}" height="100" alt="{{img_alt}}" />
{{/each}}
</template>
和以下客户端代码 main.js
if (Meteor.isClient) {
console.log("I am the client");
var img_data = [
{
img_src:"image1.jpg",
img_alt:"dental surgery"
},
{
img_src:"image2.jpg",
img_alt:"carribean night"
},
{
img_src:"image3.jpg",
img_alt:"full moon palm tree"
},
];
Template.images.helpers({images:img_data});
}
我的问题是只有 image1.jpg 出现在浏览器窗口中。