gpt4 book ai didi

javascript - 我简单的 meteor 代码有什么问题

转载 作者:搜寻专家 更新时间:2023-10-31 22:59:34 25 4
gpt4 key购买 nike

当我运行它时,浏览器中没有任何显示。HTML:

<head>
<title>projectsiddharth</title>
</head>
<body>
<h1>Hello from india!</h1>
<div class="java">{{> timetemplate}}</div>
<template name="timetemplate">
<p>The time is now {{time}}</p>
</template>
</body>

JS:

if (Meteor.isClient) {
var data = {time: new Date()};
Template.timetemplate.helpers(data);
}

if (Meteor.isServer) {

}

我是 meteor 的新手,请多多包涵。此代码用于显示当前时间。帮助赞赏,谢谢

最佳答案

尝试将模板与正文 html 分开。

<head>
<title>projectsiddharth</title>
</head>
<body>
<h1>Hello from india!</h1>
<div class="java">{{> timetemplate}}</div>
</body>

<template name="timetemplate">
<p>The time is now {{time}}</p>
</template>

关于javascript - 我简单的 meteor 代码有什么问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33996203/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com