【问题标题】:Meteor JS Jade template does not work as expectedMeteor JS Jade 模板无法按预期工作
【发布时间】:2015-05-08 00:03:07
【问题描述】:

我试过这个包https://github.com/matteodem/meteor-easy-search/使用这个示例代码轻松搜索

<template name="searchBox">
    {{> esInput index="players" placeholder="Search..." }}

    <ul>
        {{#esEach index="players"}}
           <li>Name of the player: {{name}}</li>
        {{/esEach}}
    </ul>
 </template>

并将其转换为玉

template(name="searchBox")
  +esInput index="players" placeholder="Search..." 
  ul
    esEach index="players"
      li Name of the player: {{name}}

如果我使用 html 格式,则搜索有效,但当我使用翡翠格式时,没有错误,但搜索不会显示。我是否正确地将html转换为玉?任何想法为什么翡翠不起作用?

【问题讨论】:

  • 我没在 Meteor 中使用过翡翠,但 esEach 不应该是 +esEach 吗?我猜esEach 被解释为一个元素。
  • @PeppeL-G 好收获!您能否将其作为答案,以便我接受。谢谢!

标签: javascript html node.js meteor pug


【解决方案1】:

esEach 应该是 +esEach。现在至少有 30 个字符。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-14
    • 2013-05-10
    • 2015-02-05
    • 2017-09-19
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    相关资源
    最近更新 更多