【发布时间】:2017-10-28 02:08:11
【问题描述】:
我正在做这个 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。
【问题讨论】:
标签: javascript arrays meteor brokenimage